How To Display Ads On Homepage Only In Wordpress
At the other day I got a request from one of my Advertisers, he said it’s possible for it’s text link to only appear to homepage only, not in other sub pages, I told him yes sure it’s possible. Thus I make this post as tutorial to ones seek for displaying Ads on homepage only.
What you need to do now tell Wordpress to only display the Ads on homepage only, and hide it in other pages, to get this one work we need to add additional code inside the loop in our index.php page:
<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
Put Your Ads code here
<?php } ?>
(Put the theme anywhere in your theme)
This code will make your Ads to display on Homepage only and not on archive, category, page or single pages. See you in the next post.







Thanks for the informative post. I’m going to try out the code on my wp blog as soon as I can.
[...] At the other day I got a request from one of my Advertisers, he said it’s possible for it’s text link to only appear to homepage only, not in other sub pages, I told him yes sure it’s possible. Thus I make this post as tutorial to ones seek for displaying Ads on homepage only. What [...] Related posts:Adorn 404 Page In Wordpress To Retain […]→Read it on rumahabi.com [...]