WordPress & Adsense Money Blogging
If You Can Blog You Can Earn
Browse: Home / How to Insert Google Adsense ads into a WordPress blog by Modifying Theme Files

How to Insert Google Adsense ads into a WordPress blog by Modifying Theme Files

By max on February 20, 2010

In a previous post we have seen how easy it is to add Google Adsense ads to a WordPress blog sidebar by a Text Widget.      

But what if you wish to place the Google Adsense ads not in a sidebar but in any other screen location of your blog?     

A way to achieve that is by manually modifying the source template files of the WordPress theme you are using.     

The theme source files are reachable through the Appearance/Editor entry in the admin area.     

The number and names of template source files can vary from theme to theme.     

However, there is a bunch of them which are commonly present and keep their roles across themes.     

Amongst them, there are the following ones:     

  • Main Index Template (index.php)
  • Header (header.php)
  • Footer (footer.php)
  • Sidebar (sidebar.php)
  • Single Post (single.php)

So, for instance, should you wish to have Google Adsense ads displayed on every single post, then you need to place the related Google script into the single.php source file.     

As an example, just have a look at the following image:     

Wordpress Single Post Theme File Google Adsense Ad Script example

Wordpress Single Post Theme File Google Adsense Ad Script example

and at how the Google Adsense ads get accordingly displayed at the beginning of a single post on the web:       

Wordpress Single Post Google Adsense Ad example

Wordpress Single Post Google Adsense Ad example

Do remember that whenever you automatically update the theme you are using to a new version then you have to re-insert the Google ad scripts in the template source files.

Share

Posted in Google Adsense Earning, WordPress Blogging | Tagged google adsense ads blog, Google Adsense ads displayed on every single post, google adsense wordpress blog, place google adsense ads in any screen location, source template fieles wordpress

« Previous Next »

Recent

  • Sometimes I wonder if the way Google detects and calculates AdSense clicks is always correct
  • WordPress version 3.1.3 released
  • WordPress version 3.1.2 released
  • WordPress version 3.1.1 released
  • WordPress version 3.1 released

Categories

  • Blogging Questions
  • Blogging Tips
  • Google Adsense Earning
  • Google Adsense Top Earners
  • Google for Search earning
  • News about WordPress
  • WordPress Blogging
    • Adsense-ready Templates
    • Blog Maintenance
    • Free E-Books
    • Permalinks
    • Plugins
    • Visitors Statistics
  • WordPress for Websites
  • WordPress Web Hosting

Copyright © 2012 WordPress & Adsense Money Blogging.

Powered by WordPress and Hybrid.