In your page.php file look for the sidebar call
<?php get_sidebar(); ?>
Change to this code
<?php if (is_page('1'))
{}
else {
get_sidebar();
}
?>
Replace the 1 with the page id that you want to exclude the sidebar from.
OMG Thanks so much – worked perfectly.
: )
Thanks, this was very helpful!
However, I am trying to do a slight twist on this request. I would like my sidebar to just show up on the home page and then the usual sidebar that shows up on the blog pages.
As such, following your instructions would take me a bit of time because I want to exclude the sidebar more then I want to include it.
Do you have any suggestions on how to do an exclude like this?
I also noticed that with your code the sidebar is excluded, but the space for the sidebar is still maintained. I was curious if there was a way to remove this space on the static pages which I don’t use the sidebar.
Thanks again.
Any help is greatly appreciated,
A
KS
(@karl19)
To exclude something from the frontpage and show it on all other pages, use the is_home() tag. More information about conditional tags for WordPress is here – http://codex.wordpress.org/Conditional_Tags
As for the sidebar still taking up space, it’s most likely to do with where the HTML is: if you have a HTML structure in your index.php or similar page and the sidebar gets called into this, then the structure will remain even when it’s not called. Add any sidebar-related structural mark-up to the actual sidebar.php file instead and when that file is not called, the code around it wont show either.