An Alternative Sidebar Page Template in Genesis

There are plenty of methods to achieving different sidebars on specific pages, even switching sidebars in Genesis. One I like for simplicity uses the Secondary Sidebar in Genesis as the alternate sidebar – rolled into a page template.

The default description for the built-in secondary sidebar doesn’t really apply, so first we’ll unregister that sidebar and re-register it with our preferred description. Place this in your child theme’s function.php file:

Then create a new page template, called something like template-alt-sidebar.php for instance, with the following code:

Now you’ll see the secondary sidebar in your widget area with a proper description and have a page template for the pages you want that sidebar to appear on. Plus, it uses the built-in Genesis sidebar name and hooks for ease and compatibility.

Obviously this template only works with single sidebar layouts. It will still allow you to use double sidebar layouts on other pages, though. If you are looking to make your sidebars and widgets more page-specifics, consider using the Display Widgets plugin, which allows you to choose where each widget in the sidebar is displayed.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *