WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to theming with wordpress. I have a theme layout with one sidebar at the right side of the website.

Now on my homepage and one other page i dont want to have the sidebar. On all other pages it needs to stay. How can i do this.

Any help would be appreciated.


share|improve this question
up vote 2 down vote accepted

... on my homepage and one other page i dont want to have the sidebar.

You can tell WordPress to do not generate sidebar on specific page(s) with simple condition in your page.php file (or other relevant template file).

For example the following piece of code will disable sidebar on 'About Me' page.

<?php if (!is_page('about-me')) get_sidebar(); ?>

*Note: you can use numeric ID or slug of your page inside the is_page() function.*

share|improve this answer

You will need to register another sidebar.Look at twenty theme,in function.php file for example how to do that.

share|improve this answer
Thanks, i will do! – Justmac Jan 5 '11 at 10:41

You can do this by removing the sidebar tag <?php get_sidebar (); ?> from the page templates you want.
If you use index.php as a homepage, you can duplicate it and name it homepage.php and remove the sidebar tag.

i suggest you to take a look at this pages:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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