I use the is_home() conditional tag to control when my ads show up. I prefer to only have my ads show up when single posts are viewed. Helps keep my home page looking clean and relevant.
Currently, I have my ads setup to show on all pages except for my home page. To get the same functionality setup on your WordPress simply wrap your ad codes with the code below.
<?php if ( !( is_home() ) ) { ?>
[your ad codes go here.... ]
<?php } ?>
ALternatively if you want your ads to only show up on your home page,
<?php if ( is_home() ) { ?>
[your ad codes go here.... ]
<?php } ?>
If you use static pages for your home instead, then replace is_home() with is_front_page() .
Try it out, drop me a note if you need help.
Author comments are in a darker gray color for you to easily identify the posts author in the comments
that is great but then would that affect your earnings from the ads if nobody goes to the single post?
This is brilliant man! Thanks danny for helping me out on mine! Nice n clean now
Abi, no probs bro.
Shaxx, actually most people I feel go directly go to single posts. If they search on goolgle, most likely the result will point to a single page.
But anyways, I’m not much of a ads person. As long as it pays for my hosting I’ll be happy
O ya, it also makes the site look nicer in screenshots without the ads
Awesome. I am looking for this too and a new theme,
No probs WL. I’m on a WP sould search now
. I’ll share more soon…
No probs WL. I’m on a WP soul search now
. I’ll share more soon…
is_single() will work too and more efficiently as it means that if you happen to use the index page for anything other than the front and single post pages then you’re targeting just the one page.
If you started to use the index page for your category pages too you’d need to add more conditionals in.
Handy bookmark – http://codex.wordpress.org/Conditional_Tags
Thanks for the tip Sarah.
very useful tip. thank you