Twenty Fourteen
[resolved] Remove left sidebar but keep right widget area? (5 posts)

  1. gruffalos
    Posted 1 year ago #

    Hi, Is there a way to remove the left sidebar but still use the default page template? I don't want to remove the left sidebar on all the pages, and the only solutions I've found make site-wide changes.

  2. knoppys
    Posted 1 year ago #

    Two easy ways you can do it.

    1. In the page.php template. You can add an if/else statement. This tells the site: if the page is (your-page-name) then do not display the sidebar, else display the sidebar. Its a simple code to implement.

    2. Or you can create a specific page template for the page in question (your-page-name.php) add it to your themes files and copy and past everything from the normal page template and just delete the line that reads "get_sidebar();". This menas that wordpress will use this template for the page in question. You can read more about this method here

    The first option is a bit more friendly, but if you want to make further changes to the template file then its probably better to create a new page template file as option 2.

  3. esmi
    Forum Moderator
    Posted 1 year ago #

    No! Do not edit the theme itself. First create a child theme for your changes.

    @knoppys: Please do not encourage users to edit their themes.

  4. knoppys
    Posted 1 year ago #

    Soz esmi. Should have said create a child theme first. Used to creating my own themes.

  5. gruffalos
    Posted 1 year ago #

    Thanks knoppys, I appreciate it. I am using a child theme for the first time, not as difficult as I once thought!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic


No tags yet.