How To Add AdSense ads between WordPress posts

by  jaswanth (81) on December 1, 2009   |   Leave a Comment | 743 views


wordpress_adsense_postsHello friends, adding AdSense ads between WordPress posts is quite common thing but sitll some guys are asking about this thing in some webmaster forums, so i want to give this in the  following tutorial. Hear i clearly explained how to place Adsense ads between the wordpress posts,

Hear the thing is based upon our php knowledge, just i am telling you guys.  All wordpress themes having home.php and index.php with the function

< ?php if (have_posts()) : ? >

&lt;?php if (have_posts()) : ?&gt; function will executes the all the posts for given extent so if you want to place ads in between the posts just do the following

1. Open home.php, and Find the following line

<? php if (have_posts()) : ? >

2. Above it add the following line

< ?php $count = 1; ? >

3.  Now find the for line  &lt;div class=&#034;entry&#034;&gt;

4. Add the following code below it

<? php if ($count == 1) : ?>
—– Your AdSense Code  ——–
<? php endif; $count++; ? >

5. Now just update the post, and make sure that the ad has been added to the first post listing.

Remember :

To change which post your ad is placed under, simply change the count numberExample: $count == 2 will place the ad under post 2, thats change depending upon your requirement


You May Also Like



Get Updates:
Enter your email :
     
    For getting updates directly to your mobile inbox Click Here



Speak Your Mind

Tell us what you're thinking, If you want a pic to show with your comment, go get a gravatar !






Search:


Directories:

Top Technology blogs BlogRankers.com News, latest technology, wordpress, google, yahoo, blogging, tech news, reviews, tutorials, computing, rapidshare, latest news, softwares reviews, google, googel adsense, adsense

strPro Plus WP Theme [$71.36]

Buy this Highly adsense Optimised
Wordpress Theme - Increase Your
Adsnese Income Up To 200%



Contact us: strkgroups@gmail.com
Contributers:

» sivateja
» Jaswanth

[ Total of 271 posts by Jul 30, 2010 ]

wordpress visitors

Finance