|

Random Rotating Ads & Adsense



Using the Random Rotating Ads Plugin for WordPress has several benefits, some of which were mentioned in an article back in May, however having read about many WordPress themes recently, it appears that many bloggers especially the new comers, are experiencing quite a bit of difficulty in placing Google Adsense on their posts / articles.

Therefore this article is going to go into a little more depth explaining the use of the Random Rotating Ads Plugin (I am assuming you have this plugin already installed). I am not going to deal with placing Adsense in the sidebar of your theme as that is fairly straight forward, what we are going to look at is how to get Adsense ads displaying on your single post pages. So first lets look at a typical code sheet that is responsible for building your page. 


Typical Single Post Code Sheet

Random Rotating Ads & Adsense


Looking at the above code, it easy to see why many newcomers to blogging are left scratching their heads & wondering where the hell do they put this Adsense code. I remember a few years back when I first saw one of these code sheets, my initial reaction was something along the lines of what the ” F “, so I know exactly how some of you are feeling hahaha.

Now I left the numbers from my code editor specifically to be able to point you to the exact line of code we are going to deal with, (these numbers will not show when using the WordPress editor). Ok line 7 refers to “the_title” and is wrapped in a h2 tag, this is the ideal spot to place a nice big 300 x 250 ad-block & is classed by Google as the hottest ad spot on your page.


Ok now follow these simple steps;

1. Get your Adsense code from Google and save it to a notepad as plain txt file.

2. Open your Random Rotating Ads Plugin, it is located in the left sidebar of your WordPress editor under “Tools” & is called “Datafeedr Random Ads”.

3. Create a new Ad Group called “300 x 250 Ad-Block” As shown below;


Random Rotating Ads & Adsense

 

4. Paste your Adsense code into the empty box marked Ad #1. As shown below;

 

Random Rotating Ads & Adsense

 

5. Remember to click save at the bottom of the page or you will have to start from scratch !

6. Select & copy the php code that the Random Rotating Ads Plugin gives you, as shown below;

 

Random Rotating Ads & Adsense

 

7. Paste the highlighted code above into a notepad and save as plain txt, this is simply for ease of access because you cannot access two seperate areas of WordPress at the same time.

8. Repeat steps 4 to 6 for however many Ads you want to rotate in this particular Ad-Block, it will work with 1 or as many as you require, you may also mix ads from different sources as long as you keep the sizes the same.

9. Now back to your single post code sheet, open it in your WordPress theme editor, then place your cursor at the very end of line 7 & press enter to insert a new line.

10. On the new empty line (now number 8), paste in the line of code that you saved from the Random Rotating Ads Plugin.

Note: You may either just paste in the single line of code, or you may also add the div class (lines 9 & 10) which will then give you the ability to use margin, padding & alignment on this ad-block from within your style sheet.

 

Random Rotating Ads & Adsense

 

11. As can be seen above I have added a div class to this ad-block which acts as a label & allows me to identify and apply simple styling to it from within my style sheet, as shown below;



Random Rotating Ads & AdsenseThis small snipit of code in the style sheet will align to the left, put a 10 pixel space top & bottom of the advert & also a 5 pixel padding around the advert, finally a 3 pixel border around the whole advert. Now all this is obviously not necessary it is simply a little extra styling & as mentioned above you can simply insert the single line of code & not bother about any styling.



The Final Result

Random Rotating Ads & Adsense


Now is that not quite simply the dogs gonads..? Random Rotating Ads & Adsense

So my friends by simply following these instructions & of course a little practice you can place various size Adsense adverts virtually anywhere in your blog, irrespective of the theme you are using, this process will work with all themes. The Random Rotating Ads Plugin, helps simplify the whole process & it helps to keep your code as light as possible by reducing everything down to a single line of php code, which is also an obvious speed benefit.



Related posts:

  1. Google Adsense Setup & Optimization Tips
  2. Section Targeting Boosts Adsense Earnings
  3. Adsense Earnings Crippled By PC Optimization Software
  4. Add Google Custom Search To Your Blog
Posted by on Mar 19 2012. Filed under Wordpress Plugins. You can follow any responses to this entry through the RSS 2.0. You can leave a response or trackback to this entry

You must be logged in to post a comment Login


Advertise Here:

More From This Category

Find Us On FaceBook