Support » Plugins » Ads between posts

  • I already have ads after 1st and 2nd article but now want differents ads after each posts on the frontpage. how can i do that?

Viewing 15 replies - 1 through 15 (of 20 total)
  • No one?

    Edit Main Index Template (index.php) and put the ad code after the Post Content

    Michael

    (@alchymyth)

    Forum Moderator

    please define how you want to achieve the ‘different’ part – do you have a pool of ads and want to grab one random ad?

    where are your ads coming from at the moment?

    Ads are coming from Google Admanager on this site doesburgdirect.nl
    Now you see a ad before and after the first post, but i want to put a code between every post (10 posts) for a different banner. so it will be:

    banner 1
    1st post
    banner 2
    2nd post
    banner 3
    3rd post
    banner 4
    4th post
    banner 5

    and so on

    Michael

    (@alchymyth)

    Forum Moderator

    I already have ads after 1st and 2nd article

    can you post the code?
    please use the http://pastebin.com/ for any code longer than 10 lines.

    do you have an influence which ads get shown?
    is there a limit of ads per page?

    Yes I can control the ads

    <iframe src=”http://pastebin.com/embed_iframe.php?i=PGmKBEqa” style=”border:none;width:100%”></iframe>

    Michael

    (@alchymyth)

    Forum Moderator

    you could use (theoritically – as I don’t know the actual code of your template) the $wp_query->current_post variable, which starts with zero for the first post in the loop, and a conditional statement to assign different ads for each post position (possibly adding the post ad information into an array for easier access ?)

    That’s a nice answer but i dont understand it I think.

    Michael

    (@alchymyth)

    Forum Moderator

    please start by pasting the existing code of your template – the code that you are using to show the ads – into a http://pastebin.com/ and post the link to it here.

    Michael

    (@alchymyth)

    Forum Moderator

    <?php if ($postnum == $showadsense1) {
    echo '
    <center><!-- begam{S3} --></center>
    ';
    } ?>

    is the rest done with a plugin?
    where is the $showadsense variable defined?
    is S3 connected to a particular ad?

    Yes I can make S3, A4 and so on
    yes with the google admanager plugin

    Michael

    (@alchymyth)

    Forum Moderator

    try to replace the sectiopn that I posted in my last reply, with:

    <?php
    if ($postnum == 1) {
    echo '<center><!-- begam{S3} --></center>';
    } elseif ($postnum == 2) {
    echo '<center><!-- begam{A4} --></center>';
    } elseif ($postnum == 3) {
    echo '<center><!-- begam{so on} --></center>';
    } ?>

    add as many ‘elseif’s as you need.

    Ok this is my code but its not good, can you help me please?

    Michael

    (@alchymyth)

    Forum Moderator

    but its not good

    please post alink to your site to illustrate what is or what is not working.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Ads between posts’ is closed to new replies.