Select Page

The Divi NSO Theme is developped and maintained by SPC to answer NSOs specific needs.

This Divi child theme provides a few extra options available from the WordPress administration menu, under Divi > NSO Options.

This is part 2 of the discussion around the NSO Theme options. Go to part 1.

What are sidebars?

A sidebar is a column that usually sits on the left or right hand side of every page of your website. A sidebar contains widgets which usually lists your categories, and possibly a few highlights such as a link to PopGIS and so on.

Why multiple sidebars ?

By default, the DIVI theme allows one single sidebar which will be used everywhere.

Say we define our sidebar which lists all statistics topics. This allows your visitors to browse statistics by topics easily, and that’s great :
http://training.nso.spc.int/statistics/economy/

Now say you also have a “Census” section which sits next to the “Statistics” section. While it makes senses to show the list of statistics topics under the Statistics section, you might want to have a different sidebar under the Census section.

In that case we need to define a different sidebar, such as in this example:
http://training.nso.spc.int/census-surveys/agriculture/

Create new widget area for Divi

You probably already know how to define your default sidebar from the Appearance > Widgets menu.

The widget area for the default sidebar is conveniently named “Sidebar” and looks like something like this (widgets in your website may be very different) :

When creating pages and posts you can specifiy if you want the sidebar to be in the left or right hand side of the page, or if you want no sidebar at all (see Page Layout dropdown options in Document > Divi Page settings).

The standard Divi Page settings do not let you choose a specific sidebar per page or post, but we’re going to learn to do that, starting by creating a new sidebar (i.e. widget area).

This idea here is to have a specific sidebar for the Statistics by topics section of our website. Below is a screenshot showing the end result we’re trying to achieve, with the new sidebar on the right:

First of all, head to the Appearance > Widgets page and create a new widget area:

Type in your Widget Name and hit the Create button to create a new widget area. For this example we’re going to name it “Sidebar Statistics” as it will be used to navigate between statistics topics.

Once the new widget area is created, you simply have to add widgets to it, the same way you did with the standard Sidebar area.

In this case here we have added a “Vertical Sidebar Menu” widget which lists all Post Categories (excluding thoses not related to statistic topics).

We now have a new sidebar, but the Divi standard theme does not provide an option to actually use it (unless you start playing with the Divi page builder, but we’re not going to do that here).

NSO Theme options to the rescue

In the administration, go to Divi > NSO Options and have a look at the Sidebars section :

Let’s go through the options :

  • Single / Default sidebar: use the same sidebar on all pages. This is the default behaviour provided by Divi.
  • Posts & Categories custom sidebar: if you use category pages for statistics topics, this is a good option.
  • Allow specific sidebar on Pages: this adds an extra option to select a specific sidebar for your pages
  • Allow specific sidebar on Posts: this adds an extra option to select a specific sidebar for your posts

Setting up a Posts & Categories custom sidebar is the option you want to go for when using category pages for a whole section on your website. This is actually where we would select the new Sidebar Statistics created in the previous chapter of this article. This is what we use in the statistics by topic section in the training website.
Learn more about category pages from the post on this blog.

The use of specific sidebar on pages is useful for websites having sections of pages other than statistics and want to have another specific sidebar. This is used in the Census and Surveys section of the training website.

The last option allowing specific sidebar on posts can be useful in large websites having many post categories used in different sections on your website. If not checked, all posts use the default sidebar, or the one selected in the Posts & Categories custom sidebar option if selected.