WordPress.org

Ready to get started?Download WordPress

Forums

Create a other page without sidebar (5 posts)

  1. mrbizu
    Member
    Posted 4 years ago #

    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

  2. buddha trance
    Member
    Posted 4 years ago #

    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.

  3. mrbizu
    Member
    Posted 4 years ago #

    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.

  4. buddha trance
    Member
    Posted 4 years ago #

    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.

  5. marujobhz
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags