Different sidebars for different templates
-
Hi,
I’m developing a theme/website and would like to include different sidebar for a particular archive, page, post category, etc. It’s not a problem as I can hard code it in particular templates with get_sidebar(‘my_sidebar_3’), etc.
However, I’m trying to enable end user/admin to modify the content of those sidebars in the dashboard. Is it possible?
One way I can think of is to create another post category called ‘sidebars’ and create the sidebars I want as those posts. For example: Sidebar Front Page, Sidebar About Us, Sidebar Archive Events, etc. and then I can reference them in the relevant templates. As long as nobody deletes those custom post types but I can restrict the possibility of deleting them. That way an admin can easily open/edit a particular sidebar post type, edit the content and save/publish.
Is this the best way of doing it?
Thank you
- The topic ‘Different sidebars for different templates’ is closed to new replies.