Forums

Can you hide the sidebar in a Page? (6 posts)

  1. jbeckl
    Member
    Posted 1 week ago #

    I'm wondering if it's possible to NOT have the sidebar in a Page. I have specific content I want to show, and the sidebar (with categories, calendar etc.) doesn't need to be there.

  2. jonimueller
    Member
    Posted 1 week ago #

    You can remove the call to the sidebar in your page or create a new page without the sidebar.

  3. genevaeagles
    Member
    Posted 1 week ago #

    jonimueller is totally right. There should be a page.php file in your theme folder. Copy it then rename it to anything you remember and delete the sidebar call.

    One you have done all the above the only thing you need to do is to apply this template in your "Write - Page" Section of your blog everywhere you want no sidebar.

    Could look something like this:

    <?php
    /*
    Template Name: Page Templage w/o Sidebar
    */
    ?>
    
    <?php get_header(); ?>
    
    	<div id="content" class="fullcolumn">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    		<?php endwhile; endif; ?>
    	</div>
    
    <?php get_footer(); ?>
  4. greenshady
    Member
    Posted 1 week ago #

    Unless the call to your sidebar isn't in the page template. I've never put this in any of my themes. I've always called it in the footer.

    You can always find the call for the sidebar which should be:

    get_sidebar();

    Then you could do this:

    if(is_page('Page Name')) :
    else :
    	get_sidebar();
    endif;
  5. jonimueller
    Member
    Posted 1 week ago #

    Hmm. My page template usually tracks my index.php template and most of the time I call the sidebar from index.php and then daisychain the footer, calling it in the sidebar. But that's just me, and I think that might be leftover thinking from (please don't laugh) Greymatter.

    The best solution, tho, is what greenshady proposes. :)

  6. greenshady
    Member
    Posted 1 week ago #

    The page template is a perfectly fine solution. I even offer it in one of my themes. The if statement is a little different though with that because I include the sidebar in the footer.

Reply

You must log in to post.

About this Topic