• Hi.

    I am currently making my own theme and have added several sidebars.
    I want the site admin to be able to show whatever (or no) sidebar he wants for each page.
    I have seen this implemented in several themes, and have looked and looked for the way to do it, but can’t find any place.

    So here I am, asking for your help.

    As stated I need:

    • An option in gutenberg “document” tab that allows me to chose from a list of my sidebars or “none” as an option.
    • Help to implement that in my template.

    Thanks guys!

    • This topic was modified 4 years, 4 months ago by baggyno.
    • This topic was modified 4 years, 4 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The easiest way is to create two templates, one with and one without. Name the default page template page.php. Name the other anything that’s not part of the standard template hierarchy. page-sidebar.php perhaps. On this template include a comment header as described for global use page templates. Users can simply choose to use one template or the other when they create pages.

Viewing 1 replies (of 1 total)
  • The topic ‘Toggle sidebar per page’ is closed to new replies.