Choose a sidebar for each Page/Post (3 posts)

  1. bcreighton
    Posted 7 years ago #

    With the advent of multiple sidebars and dynamic sidebars... has anyone come up with a way to declare, for example, 4 dynamic sidebars and let the user choose which widgetized sidebar they want shown on a particular page/post?


  2. bcreighton
    Posted 7 years ago #


  3. ryancp
    Posted 7 years ago #

    Hi bcreighton,

    If I understand your question correctly, you could probably set up an if else in the single.php template page that says "if the meta key $sidebar_number = 1 then include sidebar1.php", etc. for each sidebar version. Then, in your post/page, make a plugin that lets the user choose (from a drop down select list for example) which sidebar they want, and then when they save their post, insert the sidebar version as a meta key/value pair (custom field).

    I think that should accomplish what you are looking to do.

Topic Closed

This topic has been closed to new replies.

About this Topic