WordPress Tutorials Index | Web Page Design Tutorials Home

Put AdSense to WordPress Blog Contents

AdSense is the best way to make money online nowadays. Adsense can really provide a steady income therefore many bloggers will consider putting AdSense on their blogs.

The best place to put AdSense on a blog is probably on the header section and the main contents section. Since most blogger would like to put AdSense somewhere around the blog contents area, let’s discuss how to do that.

WordPress Theme: Twenty Ten

Which File Should Be Edited?

Firstly, open single.php. The comments clearly indicated that this file is used for displaying all single posts. And use the loop-single.php file to run the loop to output the post. Yes, this is really what we are looking for.

put adsense codes to wordpress contents

Open loop-single.php and see what can we find. Ha ha.. we find everything that what we are looking for:

put adsense codes to wordpress contents

Knowing the file structure to displaying the postings, we can try putting AdSense somewhere on the blog contents by editing the loop-single.php file.

Put AdSense Above the Blog Title

This is the most common way to display AdSense on blog. It can simply put the AdSense Code above the codes used to displaying the blog title:

<h1 class="entry-title"><?php the_title(); ?></h1>

put adsense codes to wordpress contents

Put AdSense Below Blog Title and Posted Date

put adsense codes to wordpress contents

Put AdSense Wrap Around Blog Contents

Many blogger like to wrap the AdSense around the contents. Yes, this is the way way to attract the attention of readers. This is by far the most efficient way to earn money with AdSense.

The idea is simple. Float the AdSense to the left side of Blog Contents.

<div style=”margin-right:12px; float:left; “>
   <!– Put Adsense Codes here –>

put adsense codes to wordpress contents

How about using the above AdSense codes in a child theme? Simply save the loop-single.php file in the folder of child theme. This will override the loop-single.php file of the parent theme.

put adsense codes to wordpress contents

Now the AdSense ads will easily attract the attention of visitors when they reading the posts.