Home > google adsense, wordpress > $ add adsense under each wordpress post by hand code $

$ add adsense under each wordpress post by hand code $

October 12th, 2008 Leave a comment Go to comments

Sometimes I dont like to use plugin to add adsense in the blog, so I tried to add it by hand code, following is an example for add adsense under each post:

Go to the file of single.php in the theme fold, read and find the code for displaying the content, the <div class=”storycontent”> should be the code to display the content, and the <div class=”meta”> should be the code to show the post meta, so just add the script under the the post meta, I use the <hr> to isolate adsense for clearance.

<div class=”storycontent”>
<?php the_content(__(‘(more…)’)); ?>
</div><!– end storycontent –>

<div class=”meta”>

Written by <?php the_author() ?><?php _e(” in:”); ?> <?php the_category(‘,’) ?> | <?php the_tags(__(‘Tags: ‘), ‘, ‘, ‘ ‘); ?><?php edit_post_link(__(‘Edit This’)); ?>
<?php wp_link_pages(); ?><br />

</div><!– end meta –>

<hr>
******paste google adsense script here*************
<hr>

Related Blogs



  1. No comments yet.
  1. No trackbacks yet.
      
                  
      

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word