The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Add adsesnse between grid style posts (2 posts)

  1. viorelepuran
    Posted 2 years ago #

    Hello guys,
    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 file for category, in pastebin
    Clcik here to see the file
    I think it needs some tweeks on line 13 , but i do not know how to do it.
    Can someone help me with it?
    I saw a example from someone, but i think it is not for grid style.Here it is:

    Ah! Now I understand. Try replacing:

    if (have_posts()) : while (have_posts()) : the_post();
    get_template_part('post', 'homepage');

    if (have_posts()) : $c = 0; while (have_posts()) : the_post();
    $c ++;
    get_template_part('post', 'homepage');
    if ($c > 2 ) {
    $c = 0;?>
    [ insert ad code here ]

    Here you can see how the end result should look like.
    End Result
    Thank you !

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    I'm sorry but as you appear to be using a commercial theme, you need to seek support from the theme's developer/vendor. We do not support commercial products here.
    Try http://www.studiopress.com/support

Topic Closed

This topic has been closed to new replies.

About this Topic