Support » Plugins » Removing Sidebar selectively

  • Resolved briannagel

    (@briannagel)


    I’ve scoured Google and other forums for a way to hide the sidebar on select pages. Couldn’t seem to find a clear, concise way of doing it in this theme. Does anyone have a solution to this? A plug-in? CSS editing?

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The easiest & most flexible method would be via a custom page template.

    Thread Starter briannagel

    (@briannagel)

    Thanks, esmi…

    I successfully made a custom template by duplicating a page, renaming it, adding those 5 lines of code at the top, and uploading it to the server. Successfully changed my page template to the newly created page. However, when I got rid of the

    <?php get_sidebar(); ?>

    code from the new template, it actually removed my header, footer, AND the sidebar. A little more than I bargained for…any suggestions?

    Thread Starter briannagel

    (@briannagel)

    I found the answer by finding the callout to the sidebar and adding the following conditional tag:

    <?php if (is_page(‘x’)) : ?>
    <?php else : ?>
    <?php get_sidebar(); ?>
    <?php endif; ?>

    Changed the ‘x’ to the name of the page.

    Thanks!

    cswake

    (@cswake)

    On a related note, could you recommend an easy way to remove the sidebar from all the pages? (Un-selectively)

    Thread Starter briannagel

    (@briannagel)

    You can actually use the same above steps to accomplish that idea – because if you’ve made a custom page template, anytime you create or edit a page, you have the option to choose which page template should be set.

    The eDegree theme only has one page template by default, so it’s not very obvious to change it up.

    I will say, however, that removing the sidebar does not automatically extend your content across the whole page. The reason I went about doing it is so I could embed a Google Calendar in a fuller view than if the sidebar was there, so I adjusted the size in the embed code to make it work.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Removing Sidebar selectively’ is closed to new replies.