Forums

How to Remove Sidebar From All Pages Except Home Page? (1 post)

  1. neutrino14
    Member
    Posted 4 months ago #

    HI. I'm using Magazine Basic theme (physicsdatabase.com). So I want to remove the Sidebar from all pages except the front page. I've tried using the conditional statement stuff, but I'm not sure where to put this code:
    <?php if (is_page('x')) : ?>
    <?php else : ?>
    <?php get_sidebar(); ?>
    <?php endif; ?>

    I've tried putting this to page.php and what happened was that all my pages displayed huge sidebars in the centre of the page. I also tried doing that custom template stuff. I created a new php file in cpanel, but it doesn't appear when I create a new page ( actually there's no dropdown menu with an option to choose template at all). So I think I should edit this code in footer.php:

    </div>
    <?php
    $loc = pbt_theme_option('sidebar_location');
    if($loc==2 || $loc==4) {
    get_sidebar(); // calling the First Sidebar
    }
    if(pbt_theme_option('sidebar_width2')!=0 && $loc!=3) get_sidebar( "second" ); // calling the Second Sidebar
    ?>
    </div>
    <!-- begin footer -->
    ...

    BUt I'm not sure. COuld somedoby help me? Cheers

Reply

You must log in to post.

About this Topic