Display custom sidebar – simple conditions

After you’ve created a sidebar, configured its options and added some widgets, it’s time to display it on the site.

Sidebar for a single Page

User is logged into the admin panel as an Editor or higher.

Sidebar - Quick Select

  1. Go to the Edit Page screen for the page you want the sidebar to be displayed on
  2. In the Sidebars – Quick Select box, click on the input field below the name of your chosen Target Sidebar
  3. Select the sidebar you want to display. You can type to search for it, or to create a new sidebar (Admin only)
  4. Click Update. That’s it, the sidebar will now be displayed on the page!

In the example image, the user has selected the Contact Sidebar to replace Sidebar on the Contact page.

Good to know: This approach will work for any public Custom Post Type on your site!

 

Sidebar for Blog and All Posts

Display sidebars on all posts and blog page

 

User is logged into the admin panel as an Admin.

  1. Go to the Edit Sidebar screen for the selected sidebar in Sidebars > All Sidebars, or by clicking on Edit Sidebar from the Widgets admin screen
  2. In the Sidebar Conditions box, click on the “– Select content type –“ dropdown and select Posts
  3. In the newly added condition, you’ll see an input field saying “All Posts / Blog Page”
  4. Make sure that the Target Sidebar is set to the default sidebar for posts in your theme
  5. That’s it, the sidebar will now be displayed on the Blog page and all single posts!

 

Good to know: Conditions are saved automatically on change, you do not need to click Update for the sidebar.

 

Condition Settings

 

If you click on Settings in the lower right corner of a condition group, you will see some extra options:

Singulars and Archives
Target content in a specific state, such as all single posts, the Blog page (posts archive), or both. See FAQ: What are the options Singulars and Archives?
Negate conditions
Display the sidebar on all content but the selected.
Auto-select new children of selected items
If a page, category, or other hierarchical item has been added as a condition, any future children/sub-items will be added as conditions as well.
Was this article helpful to you?