AutoHotKeyGoogle limits the number of ads that you can place in your blog per page. When you place the adsense code by modifying index.php so that the ad appears below a post, the ad is going to appear beneath all the posts on your blog’s homepage. This is not what we want.

For the ad to only appear under the first post and nowhere else,

The Quick Way

Edit index.php and place the following code wherever you want the ad to appear:


  <?php if ($wp_query->current_post < 1) {
adsense_deluxe_ads('above_posts');
} ?>

Replace adsense_deluxe_ads(’above_posts’); with your adsense code. If you want the ad to appear below the post, you would paste the above before <?php endwhile; ?>

Ad appearing below first post only

Source.

We’ve similarly placed 3 link units at the top of first three posts on our home page using this code:

» Read the rest of the entry..

HowToTuts.com Logo Hello and welcome to (what we aim to be) the ultimate resource for how-tos and tutorials on topics like software, PHP scripts, web mastering, technology, lifestyle and more. If you would like to ask us a question or share your how-to, please contact us.
Close
E-mail It