Support » Fixing WordPress » Remove sidebars from some pages

  • Hi there,
    I’ve looked through so many help pages now but I don’t get anything that helps me.
    I want to remove the side bars from some of the pages in my blog. The landing page to be as is but I want to remove the right bar in some pages and have the body expand to the right edge of the blog section.
    Can someone look at my blog and tell me how I can remove the right hand column on the About Me page and then extend the text of the body to the edge. This will help me figure out what to do with the other pages.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Hi,

    Check with this article:


    Shane G.

    In your page.php file you can remove the calling of the sidebar for pages. Since you’re using an Artisteer-created theme, it will probably look something like:

    <?php include (TEMPLATEPATH . ‘/sidebar2.php’); ?>

    You’d also need to re-size the middle area to compensate:
    <div class=”art-content”> CHANGES TO
    <div class=”art-content” style=”width:585;”>

    Gee thanks skylar! I am new and it can be a real struggle. But I am learning FAST! Will give it a bash.

    This works fantastically skylar. Just a quick one. This removes the sidebar from all the pages except the home page. if I want it back to say the contact us page … is that possible? Or no can do?

    Oh Skylar, the width adjustment doesn’t work 🙁
    Perhaps I need to do something in the css?

    Oops, I forgot the px at the end… 😛 Try:

    <div class=”art-content” style=”width:585px;”>

    Yes, it will remove the sidebar from all the pages. If you want it back for just the contact page, create a copy of page.php and rename it page-25.php (since the contact page URL is ), note the “25” at the end matches. In page-25.php, you can add the sidebar back to the code and it will only be used for the corresponding page with the URL ending in “25”

    Oh goodness you have been such a great help! THANK YOU! It works!!!

    Skylar. Thank you for all your help. I am now busy with another site and have managed to take out one of the sidebars. You say I must copy the page.php and make another. I did this using filezilla and then put the page-33.php into the wordpress admin.
    How do I edit this page as it doesnt’ appear in the edit section of my appearance box in wordpress.
    on the first two tabs I want sidebar 1 to appear. From My Business onwards I want sidebar 2 to appear. How do I do it so that the correct sidebar appears on all the sub-pages too.
    Am I asking too much? I have tried the training pages but I have tried what they say but it doesn’t work. If I add any PHP files they don’t appeaer on the Apparance section so I can’t edit them.
    Can you help?

    It should pop up in the appearance editor once you’ve added it to the theme folder, you should be putting it in wp-content/themes/yourthemename/page-##.php. A log out/in might help.

    You could make your original page.php the two sidebar version (which would be the default for every page) and then you could make the custom page-##.php pages for just the first two tabs to override it.

    I’m close I can feel it!

    I got rid of my side bar, but can seem to expand my content.
    <div class=”art-content” style=”width:585px;”> (is this already in the code or do I have to add this line?

    I use artisteer too.

    The only thing I see that is close to what you describe is
    <div class=”art-contentLayout”>
    <div class=”art-content”>

    My troubled page

    Thank you all, this will definitley help me. I’m totally new to WP.

    [sig moderated as per the Forum Rules]

    I think you should create a custom design for page that you do not want to embbed the sidebar in it.
    [sig moderated as per the Forum Rules]

    You could also do a conditional call for specific pages. For example:

    <?php wp_reset_query(); ?>
    	<?php if (is_home()) {
    				$post_id = 30;
    				$queried_post = get_post($post_id);
    				<h2><?php echo $queried_post->post_title; ?></h2>
    				<p><?php echo $queried_post->post_content; ?></p>
    	<?php } elseif (is_page('140')) {
    				 $post_id = 80;
    				 $queried_post = get_post($post_id);
    				 <h2><?php echo $queried_post->post_title; ?></h2>	 
    	<?php	 } else { ?>
    			//empty page
    			<?php } ?>

    This shows custom posts on specifc pages including the homepage but leaves every other page with a blank sidebar. You could customize this ad nauseum.

    Sometimes i edited the file on the editor.
    It sure will need some skills on PHP and HTML, otherwise maybe you will get stuck.
    But i don’t think my blog need removed it’s sidebar.
    As you know the sidebar is removed itself whenever the pages is not main page.

    new thing for me that two sidebar can be edited.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Remove sidebars from some pages’ is closed to new replies.