Wordpress Landing Sites Plugin With Google Adsense

Adding Adsense to the Landing Sites Wordpress plugin seems like a natural choice for anyone wishing to monetize their sites. The plugin offers the user related choices from your site, so why not use some related choices form Google Adsense as well. Here is how to do it. You may want to read up on my previous post about the Landing Sites plugin.

Here is the code for adding Landing Sites to your single.php and page.php files with the Google Adsense code:

<?php if (function_exists('ls_getinfo')) : ?>
<?php if (ls_getinfo('isref')) { ?>
<div class="landingsites">
<h2><?php ls_getinfo('terms'); ?></h2>
<p>You came here from <?php ls_getinfo(referrer); ?> searching for <i><?php ls_getinfo(terms); ?></i>. These posts might be of interest:</p>
<ul>
<?php ls_related(5, 10, '<li>', '</li>', '', '', false, false); ?>
</ul>

<script type="text/javascript"><!–
google_ad_client = "pub-********add yours here********";
google_ad_width = 200;
google_ad_height = 200;
google_ad_format = "200×200_as";
google_ad_type = "text";
//2007-09-08: single page search
google_ad_channel = "3663202440";
google_color_border = "000000";
google_color_bg = "000000";
google_color_link = "ff9933";
google_color_text = "232323";
google_color_url = "232323";
//–>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</div>

You will want to change the colors and maybe even the size of the Google Adsense advertisement to fit your theme. This will only show up on your site when someone is referred by a search engine search. Make sure to add your Adsense Client ID number.

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)