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?
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?
No one?
Edit Main Index Template (index.php) and put the ad code after the Post Content
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
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>
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.
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.
<?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
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.
please post alink to your site to illustrate what is or what is not working.but its not good
you need to move the code from lines 2 - 14 (watch for the corresponding php tags) to replace the code in lines 71 - 75;
edited code in http://pastebin.com/chF7BmGb
Works. great!!!
this might be caused by the ads you are trying to show - the code istself is working and there is some output where the logic would expect it; i.e. it is not a wordpress problem.
for instance, you are using 'fullheader1' (which seems to be {S4} ) right at the beginning, and then later in the conditional section - that ad is then not shown betweent the posts;
also, your counter starts with 0 (i.e. it is not set until it gets incremented once; but your conditionals start with 1; therefore there is no ad after the first post.
make sure to have all different ads in the differnt locations; and possibly change the numbers in the conditional section, for instance start the section with if ($postnum == 0) {
You must log in to post.