Ads in grid style

Community Forums Forums Design Tips and Tricks Ads in grid style

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  viorelepuran 8 months, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #93965

    viorelepuran
    Member
    Post count: 25

    Hello guys,
    This is a repost of my issue.
    Brad Dalton did an amazing job helping me, but i could not fix the problem.
    So i am reposting with more detailes:

    I am using a child theme with genesis, and i created a category.php to display post in grid layout.
    So now, my post are beeing displayed on 2 columns.
    Now i want to add a adsense ad after the first 6 posts.
    So it needs to be 6 posts, and after those 6 posts, a area as width as the 2 column post, containing the AD.

    Here is the front-page.php and functions.php

    • This topic was modified 8 months, 3 weeks ago by  viorelepuran.
    • This topic was modified 8 months, 3 weeks ago by  viorelepuran.
    #94014

    braddalton
    Participant
    Post count: 10587

    Its interesting that you couldn’t get this to work because i tested it locally and it worked perfectly for me.

    Tested it again and it works fine.

    widget

    Why have you added PHP for the grid?

    Did you do that to create a 2 column loop of posts?

    This is what you can use for a grid loop

    [php]

    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    add_action( ‘genesis_loop’, ‘child_grid_loop_helper’ );
    /** Add support for Genesis Grid Loop **/
    function child_grid_loop_helper() {

    if ( function_exists( ‘genesis_grid_loop’ ) ) {

    genesis_grid_loop( array(
    ‘features’ => 0,
    ‘feature_image_size’ => 0,
    ‘feature_image_class’ => ‘align none post-image’,
    ‘feature_content_limit’ => 0,
    ‘grid_image_size’ => ‘grid’,
    ‘grid_image_class’ => ‘align none post-image’,
    ‘grid_content_limit’ => 0,
    ‘more’ => __( ‘Continue reading…’, ‘genesis’ ),
    ‘posts_per_page’ => 10,
    ) );

    }

    else {
    genesis_standard_loop();
    }

    }
    [/php]


    #94016

    viorelepuran
    Member
    Post count: 25

    Hy Brad, yes i used that to create the 2 columns grid, and not i can`t go back and change it.
    I tried your suggestions, but i had no result.
    Would it be okwith you if i gave you acess to wp-admin and ftp, so you can try it on my site?
    Maybe i am missing something or i am doing something wrong when i am doing it.
    Thank you again for your help!

    #94020

    braddalton
    Participant
    Post count: 10587

    Sorry but can’t do that as its a service i only offer paying clients.


    #95258

    viorelepuran
    Member
    Post count: 25

    Hello, above line 25, i added this code <?php if($j == 6) { echo do_shortcode(‘[do_widget id=text-21]’);} ?>
    I am using Amr Short code widget to pull info from dashoard->widgets.
    That code worked for me .
    Thank you Brad for your help, you are a great guy!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.