2

What's the best practice when it comes to removing the sidebar on the wordpress homepage? I'm using wp Version 3.2.1 and Skeleton Child Theme 1.6

2 Answers 2

0

This very much depends on the theme you are using, but here is how you would go about it.

Locate where the sidebar div is being added. Then wrap the sidebar in a !is_home() check then it will only load on pages that are not home.

You will probably also need to add a class using the same logic so you can also tweak the widths with css. If you hide the sidebar, the content area will need to be set to 100% for example.

Is this the skeleton theme you are using?

http://www.simplethemes.com/blog/entry/skeleton-wordpress-theme

If not, please send a link to the one you are using and I can help a little more :)

3
  • 1
    Be very careful. Do you mean the Site Front Page (i.e. is_front_page(), or the Blog Posts Index (i.e. is_home())? The two are not always the same. Commented Nov 3, 2011 at 15:30
  • andy, @chip thanks for the answers, I figured it out eventually: First I set up a regular page as my site home page and then, while editing the front page, I set the template to "designer page - no sidebar or page title"
    – Bogdan
    Commented Nov 4, 2011 at 20:40
  • @ChipBennett thanks for clarifying. I should have noted that. Bogdan, glad you got it sorted. I get that you used a page template assigned to the home page. But I didn't get what you meant by " I set the template to "designer page - no sidebar or page title" I assume that is a feature of the template.
    – Andy James
    Commented Nov 5, 2011 at 11:16
0

I usually always create a separate page template for my homepage as it is the most unique page of the site and not really like any other page. I create a page called 'Home' in pages, then go to settings > Reading and the first option that says 'Front page displays' I select my home page. Then create a page called 'page-home.php' and remove the function call get_sidebar() from the template, voila.

Much like anything in Wordpress, this is one way of many. The is_home() or is_front_page() functions can also be beneficial, but I find it to be better practice to create a separate template as it works better for me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.