More Effective Ad Placement using the Wordpress Plugin ‘CG-InBetween’
December 12th, 2007, Posted in Wordpress PluginsSure, sticking your adsense ads in the sidebar of your theme is one way to go… and certainly a start. Yet, ads placed nearer or inside of your main body of content offers much better results in most cases. So how do you go about getting ads into these prime real estate areas without digging into the code?
How to get ads (or anything else, for that matter) to show up inside or between your Wordpress posts within the next 10 minutes
You can use the very popular Adsense Deluxe plugin to manually place ads into articles as you write or edit them, but this can become rather tedious. …And does nothing for those of you who want to display ads between, say every 2 posts. Luckily there’s a great plugin ready to help you out on your quest for better ad placement (and even the serving of more relevant ads).
Follow along and find out how to utilize the very versatile Wordpress plugin ‘CG-InBetween’. Though this plugin has not yet made it onto the official Plugin Compatibility list for Wordpress 2.3 generation, I have tested it on 2.3 and 2.3.1 and find the plugin to work as great as it always has. (I Promise I will do my little part and add it to the list as soon as I remember what my password is for the WP site, scout’s honor)
- Download and install the CG-InBetween plugin.For those needing more explicit instructions, this means uploading the plugin files to your ../wp-content/plugins directory. Then go to the ‘Plugins’ tab of your Wordpress admin panel and click ‘Activate’ next to the CG-InBetween plugin.Now there will be a new admin panel tab called ‘InBetween’.
- Insert your ad code in the ‘InBetween’ page of your Wordpress admin panel.
Pretty straightforward, simply paste your ad code into the field labeled ‘echo’. In the first field, ‘between’, you can either tell the plugin to insert after the nth post, or after every n posts. If you only want your ad to show up once after the third post, you’d enter ‘3′. ‘All’ places the ad after every post and ‘last’ places it after -you guessed it, the last post on the page.
Let’s say you want to have ads after every 2 posts. Just create 3 different ‘InBetweens’, one with ‘2′, one with ‘4′ and one with ‘6′ as the ‘between’ values.
- Insert the plugin code into your theme -Important!
One more step is required to get your InBetweens to function. Insert this code: <?inbetweenPosts();?> into the theme file where you want your ads to appear. Usually this will be the index.php file. If you only want InBetweens to display on category pages, you’d edit the category.php file, for example.
Open the index.php file of your current Wordpress theme and look for <?php endwhile; ?>
This marks the end of ‘the loop’, meaning the end of the section of code that generates each post entry. Place the plugin code somewhere bewteen the beginning and end of the post loop like so:
<?php while (have_posts()) : the_post(); ?>
<?php inbetweenPosts();?>
<?php endwhile; ?>There will be other code in your theme, but the important thing is that the plugin code goes after <?php while (have_posts()) : the_post(); ?> and before <?php endwhile; ?>
That’s it! You can create as many ‘InBetweens’ as you like. Experiment to find out what works best for you.










