I always wanted to show an Adsense ad unit below the first post in my blogs. I only show summaries of posts on the home page in order to prevent duplicate content issue. So I thought that showing an ad unit below the first post’s summary will be good.
I tried to find a solution but I wasn’t very lucky. I tried few WordPress plugins but failed to find what I was looking for. Then I searched the internet for any possible solution. I finally got my answer after few hours of search on the internet.
Here is what you need to do in order to display an ad unit on your home page after only the first post.
Open [you can use any software like dreamweaver] the Index.php page of the theme that you are using [download it from your server if you don have it in your PC].
Now look for this function in the index.php file
the_excerpt
Or this function
the_content
The first function, which is [the_excerpt], is used if you want to show only summary of posts on your blog’s home page.
Where the function, the_content, is used if all the content of the post is displayed on the home page.
Below the line where this function ends, you will have to add this code.
<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
Put Adsense Ad Code Here
<?php } ?>
Save the file and then upload it. You will now see an ad unit below the first post [only] on our home page.
Related Stuff
Google Buzz Button Wordpress Plugin ReleasedIf you are looking for a Google Buzz button to add into your Wordpress site then we have released the first Wordpress plugin exclusively ...
Plug And Play Ecommerce With Wordpress PluginsSince 2003 Wordpress has slowly been gaining popularity amongst the elite of the internet, the bloggers. It is one of those few things ...
Add Google Search to Your WordPress BlogThe native WordPress search does not return very relevant results, thus it makes a lot of sense to add Google Search into your WordPress ...
Add More Sidebars to Your WordPress ThemeYou can add more than one sidebar section to your WordPress site. For example, with the stc-intermountain.org site, I added a whole bunch ...
Series Posting in WordpressIn my functions.php file, I have some code which implements series posting. This relies on the thematic ...

Original Source: