How to: Display Adsense After The First And After The Any Post In WordPress Blog
Step 1
The step 1 is to open up your index.php file from your wordpress theme folder in your favorite theme editor such as like Dreamweaver or Notepad. Find the following line:
<?php if(have_posts()) : ?>
Step 2
Just copy and paste (below Red Bolder code lines ) like this:
<?php
$postnum = 1;
$showadsense1 = 1;
$showadsense2 = 2;
?>
<?php if(have_posts()) : ?>
Step 3
Scroll down the page and find this line:
<?php endwhile; ?>
Step 4
Just copy and paste the (below Red Bolder code lines ) like this:
<!--Google Ads Code Start Here--!>
<?php if ($postnum == $showadsense1) { include (TEMPLATEPATH . '/adsensepost1.php'); } ?>
<?php if ($postnum == $showadsense2) { include (TEMPLATEPATH . '/adsensepost2.php'); } ?>
<?php $postnum++; ?>
<!--Google Ads Code End Here--!>
<?php endwhile; ?>
Step 5 (Final)
Just make the 2 files, one is “adsensepost1.php” and 2nd is “adsensepost2.php” and Save As the files with “.php” extension,
make sure are both files put in same theme directory…. that’s it… Now Enjoy to make more money.











Discussion
Useful post. good luck.
Gives errors
Actually it works fine. When copying the code the ” ‘ ” needs to be changed to ” ‘ ”
So basically it has the incorrect ascii character when copy paste. Thanks for the code
Adsense is my main source of income when making money online. nothing beats adsense when it comes to making money online.
Adsense is the best paying make money online program on the internet. I just wish that i could increase my website traffic to high levels so that i could earn more money on Adsense.
i love Google Adsense, it allows me to make money on my personal blog and some of my health related sites.
This code does not work in IE6… any suggestions?
Thanks
Got it to work in IE by removing the last exclamation marks on the Google Ads Code Start Here & Google Ads Code End Here messages
I recently added an Adsense square ads on my travel blog. my adsense earning is still low since i dont have large volume of internet traffic yet.
`
Okay i got an ad after the first post but why not after the second post.
Trackbacks and Pingbacks
Leave a Reply