• On the theme, under template options for pages there seems to be no option for sidebar removal. Is there a way to have a page without a sidebar?
    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • The best way to do that is to edit the template page.php
    In your admin go to Appearance > Editor
    Navigate to the page.php

    Look for <?php get_sidebar();?>
    It should be near the bottom
    Just delete that sentence.

    You may want to do a ctrl x just in case you need to put it back in there using a crtl v.

    Good luck

    Thread Starter BelvidereGreen

    (@belvideregreen)

    Thank you for your help. I am looking to do it for just one particular page. Would your suggestion erase it for every page?

    It would yes.

    What you can do instead is check to see if it’s that page or now using an if statement.

    Something like this:

    <?php if (is_page(pageidgoeshere)) ?> {
    echo '';
    }else {get_sidebar();}?>

    The pageidgoeshere corresponds to your page number.

    You may want to make small correction:

    <?php
    if (!is_page(pageidgoeshere)) {
      get_sidebar();
    }
    ?>

    Thanks for this tip gang, but it does not seem to work in the latest version. The content of the sidebar is gone, but the column remains. Any other suggestions? Example with the above implemented (I just deleted the line from the page template in this instance):

    https://modernservantleader.com/about/comments-policy/test-only/

    Found it. I also had to remove the <div id="content"> and closing tag. That did it.

    I sometimes create a second page template called wide-page that doesn’t have a call to the sidebar and also has a #wide-content division with adjusted width.

    Then you can use that template anytime you want when writing a page; just use the dropdown and choose it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Page Template’ is closed to new replies.