Forums

[resolved] Removing the Sidebar on some pages (9 posts)

  1. twentytwoo
    Member
    Posted 3 years ago #

    Hi Guys,

    On some pages I need to completely remove the sidebar and use the entire width for page content.

    What's the best and easiest way to approach this?

    Cheers,

  2. JLeuze
    Member
    Posted 3 years ago #

    How you accomplish this really depends on which theme you are using, and your website specifically. Can you provide that information?

  3. the_doctor199
    Member
    Posted 3 years ago #

    I need to know the same, my site is shoottothrill.co.uk if you could help that would be great!

  4. JLeuze
    Member
    Posted 3 years ago #

    You need to make a Page Template that only has one column. This should be pretty simple to do.

    Make a copy of page.php, and rename it onecolumn.php, then open onecolumn.php in your favorite text editor.

    Add this code to the very top:

    <?php
    /*
    Template Name: One Column
    */
    ?>

    Then take this line:

    <div id="content">

    And replace it with:

    <div id="content" style="width:975px; padding-right:0px; border-right:0px;">

    Finally, remove this code from the onecolumn.php file:

    <div id="sidebar">
    <?php include(TEMPLATEPATH."/l_sidebar.php");?>
    
    <?php include(TEMPLATEPATH."/r_sidebar.php");?>
    </div>

    Then you just need to upload it to your theme, and choose that template on the pages you want to only have one column.

  5. the_doctor199
    Member
    Posted 3 years ago #

    Got everything working, a huge thanks for that!

  6. JLeuze
    Member
    Posted 3 years ago #

    No problem Doc, I'm glad that it worked out for you!

  7. twentytwoo
    Member
    Posted 3 years ago #

    jleuze: That's great advice. Appreciate your time and support!

  8. JLeuze
    Member
    Posted 3 years ago #

    It's good to hear that it worked on your theme too, 22!

  9. paydroe
    Member
    Posted 3 years ago #

    What if the theme does not have the code

    <div id="sidebar">
    <?php include(TEMPLATEPATH."/l_sidebar.php");?>

    <?php include(TEMPLATEPATH."/r_sidebar.php");?>
    </div>

    in the page template? I am using the "inove" theme.

Topic Closed

This topic has been closed to new replies.

About this Topic