As you probably have noticed that most WordPress blogs have the same sidebar on all blog pages. While sidebar is important, sometimes it is not necessary for the homepage. In this article, we will share how you can hide the sidebar on your WordPress homepage.
One of the ways to do is by creating a completely new custom homepage for your WordPress blog, or you can simply make the change by using the code from this tutorial.
First open your index.php and locate the following code:
<?php get_sidebar(); ?>
Then Replace the code with:
<?php if (!is_front_page()) {
get_sidebar();
} ?>
And thats it. Now your Front Page will not have the sidebar.








Thank you very much!!!
It worked perfect!!!!
Thanks! Just what I was looking for, and worked as advertised.
What if you want to hide it on the contact page rather than the homepage…? Thanks.
Then you use one of the available WordPress conditional tags to do so.
http://codex.wordpress.org/Conditional_Tags
Just wanted to add on this that I’ve been finding the ‘get_sidebar’ code in the footer.php.
If you can’t find it in index.php, try there.
Nice and simple hack! Saved me some other theme modification that i feared would mess up things
Great Hack buddy
Works fine
Great tip dude! Thanks
thanks for the tip..
thanks for the tip
going to try this now
Your instructions are a timely find. I just set up a static homepage and figured out how to remove the first code (and things looked right).
Now I have pasted in the replacement code. I’m not a coder, but I bet doing that will avoid problems down the road.
I shared this fix with my fellow PrimePress theme users at our support forum.
Hi
When I opened up my index.php file, the code didn’t actually have the bit you stated above. It only had the following text. Could you tell me which bit to replace here?