02 January, 2013

Google Adsense Ads Between WordPress Posts

If you want to increase your Google Adsense earning you should place google adsense ads between wordpress posts on the index page or your wordpress blog.Today i will teach you how to place google adsense ads between wordpress post. There is also some plugin are available but i will teach you a manual way for placing google adsense. So lets start!.

  • Login to WordPress Admin Panel and navigate to Appearance > Theme Editor
  • Now, Find and click on index.php (Main Index Template ) template from right listed files list.
  • Find This Code
    <?php if (have_posts()) : ?>

    • Replace above code with following given code

    <?php if (have_posts()) : ?>
    <?php $count = 1; ?>

    • Now find following code

    <div class=”entry”>


    <div class=”entry”>
    • Add following code after above searched code.

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

    By defafult the add will be displayed after 1st post, BUT If you want the add under desired number of post, simple change $count == 2 the figure.

    Muhammad Shoaib have a good experience in the field of Blogging since decade. If you are a new blogger who just starts your blogging career then www.shoaibonline.com is the perfect place to learn about blogging.