Genesis makes it super easy to create new sidebars to accompany your content.
By default, it displays the same sidebar on every page – it’s called Primary Sidebar – but if you want specific Posts and Pages to have their own individual sidebars with their own widgets, Genesis can do that too.
Here’s the code to install onto your Genesis site (here’s how) to register a custom sidebar. This particular example registers a sidebar intended for Posts but not Pages.
The arguments you can pass to
description amongst others) are the same that you can pass to the WordPress native function
When your new sidebar is registered, you can go into your widgets control panel and add the widgets. If you were creating a sidebar for Posts only, you’d add the widgets you want on Pages (for example, the Genesis eNews widget) to the standard Primary Sidebar, and add the widgets you want on Posts only (for example, the Latest Posts widget) to the newly created Post Sidebar. See below.
Sidebar or Widget Area?
Since Genesis version 2.1.0, there is a new function
genesis_register_widget_area that is identical to
genesis_register_sidebar. The reason is that widget areas don’t have to display as sidebars but can be used for any part of a website.
If you’re registering a widget area that’s not intended as a sidebar, you might find that the terminology of
genesis_register_widget_area makes more sense.
The usage is the same:
Outputting a Widget Area
Registering a widget area allows you to add widgets to it, but you also have to install the code to output it on your site. The function
genesis_widget_area is used to output a widget area.
Genesis Simple Sidebars
Genesis Simple Sidebars is a popular plugin that lets you create additional sidebars and assign them to individual Posts and Pages without needing to write any code.
genesis_register_sidebar has been included since version 1.0.1.
genesis_register_sidebar is located in lib/functions/widgetize.php.
Relevant tutorials from the Genesis community.