Add Ads Between WordPress Posts
Posted by Asuka_Aki | Posted in Wordpress | Posted on 13-06-2008 |
Tagged Under : adsense
The process of adding ads, code and images between blog posts is easier than you might think.
First log in to your admin’s dash board and click “design” then click “theme editor”.
1)Depending on your currant theme you should have an Index, Archives and Categories page. These are the pages you can add code or ads between the posts. Select the page you want to edit.
2) Then find, (hit “CTRL + F” on your keyboard to open a search box)
If your theme uses excerpt:
Look for: the_excerpt
If your theme uses full posts:
Look for the_content
3) Right after the line of code that contains the_content or the_excerpt, add teh following snipped:
<?php $postcnt++; if ($postcnt == 1){ echo 'adsense code'; } elseif ($postcnt == 3){ echo 'adsense code'; };?> |
Please note you can change the value of post count to anything you like. If you want an add after the third post change 2 to 3.
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!




[...] Look for the_content…Read More? [...]
Can you please look at my index file and show me where to put your code, I couldn’t find either “the_excerpt” or “_the content”?
Thanks in advance!
Sorry, I forgot to post the code:
<div class=”post” id=”post-”>
<a href=”" rel=”bookmark” title=”Permanent Link to “>
By Rate this story:
Posted under
Not Found
I’m Sorry, The page you are looking is not here!!
var gaJsHost = ((”https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(”%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
var pageTracker = _gat._getTracker(”UA-5070959-1″);
pageTracker._initData();
pageTracker._trackPageview();
<div class=”post” id=”post-”>
<a href=”" rel=”bookmark” title=”Permanent Link to “>
By Rate this story:
Posted under
Not Found
I’m Sorry, The page you are looking is not here!!
var gaJsHost = ((”https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(”%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
var pageTracker = _gat._getTracker(”UA-5070959-1″);
pageTracker._initData();
pageTracker._trackPageview();
I’m having trouble posting all of my code.
Hi Larry I just went to peek at your blog, can you tell me what theme you are using, then I could probably help you out more.
the theme is Connexion. Let me know if you need for me to email you a file.