Page Template (8 posts)

  1. BelvidereGreen
    Posted 6 years ago #

    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?

  2. 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

  3. BelvidereGreen
    Posted 6 years ago #

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

  4. 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.

  5. MichaelH
    Posted 6 years ago #

    You may want to make small correction:

    if (!is_page(pageidgoeshere)) {
  6. BLichtenwalner
    Posted 6 years ago #

    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):


  7. BLichtenwalner
    Posted 6 years ago #

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

  8. Joni
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic