Hack your way to better Adsense ad placement
This is a quick tip I’d like to share to those running WordPress with themes that do no have a “single.php” page. The problem with those themes is that whatever ad you paste in the index.php will both appear on the main page and the full entry page. Thus, if you want to use the high performing ad sizes (336×280), it’ll ruin your blog’s layout. Others resort to just using the standard 486×60 or use the comments template instead (which doesn’t completely solve the problem).
If you want your ads to show up just in the full entry page and not in the main page, you will need to do some simple hacking which involves a little PHP:
The PHP function if($single) is just a condition that tells the page to show the ads (echo function) only when it is on the full entry page.
Take note of the backslash (\) added just before each double quotes (“) in your original Adsense codes.