Create new sidebars, select which is used when editing a page
CSS PHP JavaScript Shell
Latest commit f0ee8b1 Jun 7, 2016 @billerickson add override filter
Permalink
Failed to load latest commit information.
bin
cmb2
tests
.editorconfig
.gitignore
.travis.yml
Gruntfile.js
README.md
be-sidebar-selector.php
package.json
phpunit.xml.dist
readme.txt

README.md

BE Sidebar Selector

Contributors: billerickson
Tags: sidebar
Requires at least: 4.1
Tested up to: 4.5.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Create new sidebars, and select which sidebar is used when editing pages

Installation

Download the plugin here. Once installed, go to Appearance > Edit Widget Areas create new widget areas. Go to Appearance > Widgets to populate those widget areas with widgets. When editing a page, use the Sidebar Selector metabox to select which sidebar to use for that page.

Place the following code in your theme wherever you'd like the sidebar to appear (typically in sidebar.php):
do_action( 'be_sidebar_selector' );

Customization

The following filters are available to customize the default settings.

  • be_sidebar_selector_override - Modify the sidebar (slug) used. Default: string if sidebar specified, false if none
  • be_sidebar_selector_post_types - What post types this can be used on. Default: array( 'page' )
  • be_sidebar_selector_default_sidebar - The name and id of the default sidebar. Default: array( 'name' => 'Default Sidebar', 'id' => 'default-sidebar' )
  • be_sidebar_selector_widget_area_args - Customize the $args passed to register_sidebar(). Useful for setting things like before/after widget, before/after title, etc. Example. Default: empty array

Screenshots

Edit Widget Areas

edit widget areas

Widgets

widgets

Sidebar Selector

sidebar selector