Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #5137

    We need to add an ad in the post loop directly after the 1st (full-width) featured post. I’ve looked at the code, but I have no idea how to add.

    This is the code we used in the old theme but I tried this everywhere within the loop-index.php

    Code:
    <?php if ($adcount == 1) : ?>

    <!– BuySellAds.com Zone Code –>
    <div style=”margin: 0 0 20px 0; height: 126px;”>
    <div id=”bsap_1252797″ class=”bsarocks bsap_b8c7a02764400e5ca5113690f392c085″></div>
    </div>
    <!– End BuySellAds.com Zone Code –>

    <?php endif; $adcount++; ?>

    <?php comments_template(); // include comments template ?>

    <?php $adcount++; ?>

    This is important to get this ad inserted in the proper place.

    Please advise,

    GF

    #48991

    Hey,

    are you sure you’re not missing any scripts? It seems you need javascript to make this do anything.

    #48992

    Until I got a response, I inserted this code below the post loop:

    Code:
    <div style=”margin: 0 0 20px 0; height: 126px;”>
    <div id=”bsap_1252797″ class=”bsarocks bsap_b8c7a02764400e5ca5113690f392c085″></div>
    </div>

    It works fine – but I need it under the top featured post…..would assume it needs some sort of counter to make sure it lands after the first post and not under every post.

    GF

    #48993

    I’d change the counter code from:

    <?php if ($adcount == 1) : ?>

    to:

    <?php
    $adcount = 0;
    if ($adcount < 1) {
    ?>

    The code will only show for the first post then.

    #48994

    Can you tell me where in the loop or code, I would place this code to get it to show after the 1st “article”?

    Thanks,

    GF

    #48995

    Ok in this case use:

    <?php
    $adcount = 0;
    if ($adcount == 1) {
    ?>

    The only difference to your code is that I defined $adcount first.

    #48996

    Dude,

    I do appreciate your response, but I’m still confused about how and where to add the code and exactly what the code should look like. I know nothing about php, so I certainly be greatful, if you could provide an example of how the code would look with the ad and where in the loop-index.php the code would be inserted.

    Thanks again,

    GF

    #48997

    You need to place:

    $adcount = 0;

    before the post loop and the if condition:

    <?php if ($adcount == 1) : ?>

    <!-- BuySellAds.com Zone Code -->
    <div style="margin: 0 0 20px 0; height: 126px;">
    <div id="bsap_1252797" class="bsarocks bsap_b8c7a02764400e5ca5113690f392c085"></div>
    </div>
    <!-- End BuySellAds.com Zone Code -->

    <?php endif; $adcount++; ?>

    inside the post loop.

    #48998

    Thank you! Got it working, but I had to change

    <?php if ($adcount == 1) : ?>

    to

    <?php if ($adcount == 0) : ?>

    to show under the very top post.

    I really appreciate the help!

    GF

    #48999

    Glad that it works now :)

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

The topic ‘BuySell Add Placement after Featured Post’ is closed to new replies.