Ads in grid style

Community Forums Forums Design Tips and Tricks Ads in grid style

This topic is: not resolved

This topic contains 11 replies, has 2 voices, and was last updated by  viorelepuran 9 months, 3 weeks ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #93152

    viorelepuran
    Member
    Post count: 25

    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

    http://pastebin.com/wxzBMUpt

    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:

    <?php
    if (have_posts()) : while (have_posts()) : the_post();
    get_template_part(‘post’, ‘homepage’);
    endwhile;
    with:

    <?php
    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 ]
    <?php
    }
    endwhile;

    Here you can see how the end result should look like.

    http://postimg.org/image/qlawdlyc7/

    Thank you !

    http://test.sneakerbardetroit.com/
    #93153

    braddalton
    Participant
    Post count: 10682

    Please paste all the code in a Github Gist and embed the Gist here. Thanks


    #93154

    viorelepuran
    Member
    Post count: 25

    Hy brad, thank you for your reply.
    I did as you told me to do.Please tell me if the code from category.php is enough, or if you need something else.
    <script src=”https://gist.github.com/anonymous/9320928.js”></script>

    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    #93158

    viorelepuran
    Member
    Post count: 25

    Why can i not embed the Gist here?
    Can you see the code?

    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    #93161

    viorelepuran
    Member
    Post count: 25
    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    #93170

    braddalton
    Participant
    Post count: 10682

    Try the clone link.


    #93171

    viorelepuran
    Member
    Post count: 25

    is this ok?

    #93173

    viorelepuran
    Member
    Post count: 25

    Yes, it is ok now.
    Do you have any ideea of how to place a ad after the 6th post, like shown in the bellow image?

    http://postimg.org/image/qlawdlyc7/

    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    • This reply was modified 9 months, 3 weeks ago by  viorelepuran.
    #93175

    braddalton
    Participant
    Post count: 10682
    #93190

    viorelepuran
    Member
    Post count: 25

    Thank you for your effort. I tried all 4 codes on the link you gaved me, but only the las one seems to work for me.
    The thing is that it replaces the 6th post excerpt withe the add.I need it to place the ad bellow excerpt, and to be as whidth as the 2 columns. I think the first code, with black background would work, but maybe i am doing something wrong…
    Can you please look again at that code?
    Here is the link with the working last code

    http://test.sneakerbardetroit.com/

    #93195

    braddalton
    Participant
    Post count: 10682

    I tested all of them and they all work perfectly.

    I also tested this solution on a HTML 5 theme using the grid loop on the home page with this code and i know for a fact it works.

    https://gist.github.com/braddalton/617807f3310b87ded754


    #93197

    viorelepuran
    Member
    Post count: 25

    It does not works…would it help you if i gave you access to ftp and wp-admin?

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

You must be logged in to reply to this topic.