Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using a child of the twentyten default theme and I want to hide the sidebar on some pages.

What is the solution for that?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

Actually, Twentyten has a no-sidebar page template already.

before

Modify the template option in the page edit screen:

Template Option

And viola:

After

share|improve this answer

create a new page template, simply duplicate the current page.php or index.php. remove the following:

<?php get_sidebar();?>

and place a template title at the top of the file

<?php
/*
Template: No-Sidebar Template
*/
?>

Then you can choose that when publishing.

NOTE: This will probably impact on your styles, may need to tweak your stylesheets.

share|improve this answer

You can use conditional template tags on your standard page file template

if( ! is_page('page_name')){ get_sidebar();}

or

if( ! is_page(page_id) ){ get_sidebar();}

You can also pass an array

is_page(array(42,'about-me','About Me And Joe')) 
share|improve this answer

Your Answer

 
discard

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.