The sidebar is a very important part of a wordpress blog but sometimes you just don’t need it displayed in the Front Page of your Website. For example, You want to build a sales letter type of website and you will not be needing the sidebars on the front page but needs it on the other pages of the site.  Read more to know how to do this:

Find index.php on your theme and open it and find the code below :

1
<?php get_sidebar(); ?>

Replace it with this :

1
2
3
<?php if (!is_front_page()) {
    get_sidebar();
} ?>

That’s it!  The sidebar will no longer be included on your Wordpress Front Page but still be displayed on your other pages. The tag
is_front_page is built-in to wordpress and means the “front page” , the exclamation mark on it means not frontpage so basically it says “If the page is not the frontpage display sidebar”. Was that easy or what?!

Tell your stories on how you used this hack below :

Popularity: 32%