
WebDesignLove is running on the premium wordpress theme called Headway. I bought the Headway wordpress theme because I was looking for a drag and drop theme. It is a great drag and drop theme that lets you tweak so much without playing in the html or php code. These terms would scare any beginner website owner who just wants to get their website up and running but looking how they want it.
I did come across a situation where you would need to know some of the code stuff to get Headway to display Google adsense ads they way you want it to though. Let me show you.
Using Easy Hooks in Headway for Adsense Ads
In the Headway theme you have a choice to use “Easy Hooks”. These hooks are areas on your website where you can insert html code or script like adsense ads.
So I wanted to show visitors Google adsense ads only when they view the single post not when they see my home page with the recent posts excerpts. This is where I needed to know about WordPress conditional tags.
Using Conditional Tag “is_home”
So in the Headway easy hooks section I choose “After Featured\Single Post Title”.
So as you can see from the image that means ads will show below the posts headline.
So if you just put your adsense script in the box it will show the adsense ads no problems. But this is where I had to use the conditional tag is_home to stop the ads showing on the home page. This is what I had to put in the easy hooks box:
<?php if ( ! is_home() ) {?>
<script type=”text/javascript”><!–
google_ad_client = “pub-YOURADSENSECODEHERE”;
/* 336×280, created 02/01/11 */
google_ad_slot = “4686401619″;
google_ad_width = 336;
google_ad_height = 280;
//–>
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
<?php }?>
Viola! My ads no longer appear on the home page of the blog. Like this image shows:
Hope this helps.


