PHP: inserting AdSense code to the WordPress classic theme

In the ‘Main Index Template’ (index.php) just add the following line have an Adsense ad between the post end and the comments.

Scroll to find

  <div class="storycontent">
    <?php the_content(__('(more...)')); ?>

and insert

    <?php if (is_single()){ ?>
      <div class="ads"><...AdsenseCode...>
      </div>
    <?php } ?>

that should be followed by

  </div>

Well, the ‘class=”ads”‘ is not neccessary, I just added it to the css file to center the ad.

Makin’ ye some pieces o’ eight! Yo ho!

This entry was posted in blog, monetization and tagged , , , , , . Bookmark the permalink.
Be Sociable, Share!

Leave a Reply

Your email address will not be published.