Support » Fixing WordPress » Create a other page without sidebar

  • HI everybody

    I used WP ver 2.7.1 for my website (with a sidebar). Sometimes, i want to create a page (or post)have format without sidebar. Anyone can help me for it ? (make the option “with sidebar” or “without sidebar” when creating a new page or new post).

    Thanks so much

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can create a template without the sidebar. Make a copy of page.php and rename it page-nosidebar.php

    Open up the file, and at the very top add

    <?php /*
    	Template Name: No sidebar page
    */ ?>

    Then, from the code, remove the part that calls the sidebar
    <?php get_sidebar(); ?>

    When you create or edit a page, select “No sidebar” from the attributes and assign it that template.

    That will work for pages.

    Thanks for your support.

    I followed your method, after removing the side bar, it leave a empty space. Now, I want stretch the content to fit the current page. Could you please tell me how to do that ?

    Thanks so much.

    You can add a width css style to the page-nosidebar.php

    The specifics depend on your theme, but let’s say that your page.php has, just before the loop
    <div id="primary" class="page">

    on page-nosidebar.php you add the width
    <div id="primary" class="page" style="width:900px;">

    Adjust width accordingly. You could even try with “width:100%;”

    Hope this helps.

    hi Buddha! you save my day with this little tip: add the style… very simple!! works for me! thanks a lot!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Create a other page without sidebar’ is closed to new replies.