28 October 2009

Google adsense for your wordpress theme (Part 2)













You can edit the theme either in your wordpress admin panel or you can edit it in your favorite text editor and upload it later. I’m going to edit in wordpress theme editor.



Step1:

Login to your wordpress blog admin panel and then go to presentation>Theme editor

If you don’t have the theme editor option it means that you are not allowed to modify the theme.

First we are going to place the ads in main page

Step 2:

In the theme editor open main index template

And look for and add this line immediately after it

Now look for this line and add just before it. The count variable will keep track of the number of posts in the main page.

Step 3:

Search for this line in the main index template



This line displays the content of your post.

Paste these lines before or after that line










The above lines will ad a horizontal linked unit, bigreactangle, biggrecatangle referral after the title of your post ( If you place these lines before )

Step 4:

Now update the file and open single post

Look for this line and place

before it and after it.

This will display horizontal linked unit after the post title and big rectangle at the end of the post.

Step 5:

If you want to display the ads in archives and search results page follow the steps followed for the main page.

To display ads in your sidebar just paste the adsense code in your text widget

To display ads in the middle of a post use adman plugin.

Note: Make sure that you don’t have more than 3 linked units,3 ad units and 4 referral units.


CHitika