The much maligned 3.7.7 release had some rather bright spots that got buried under the chaos of bugs. And judging by the support requests and false positives reported as bugs on the forum, I believe one of these features needs some elucidation.
How Many Sidebars?
One question I have had to fend with previous releases goes along these lines:
I want to have 2 sidebars on my front page, which is a Blog page, and no sidebars for the individual posts themselves.
The typical response to this used to be:
- Create a new static page.
- Assign it a template like Single Left, Single Right Sidebar from the right side of your Add Page or Edit Page screen.
- Go to Settings → Reading, and set the page you just created as the Home Page.
The above approach has limitations. The key shortcoming is that this way you can only create a static home page – not a dynamic page of posts.
So I introduced a way to get around this.
If you go to Sidebar Configuration → Sidebar Layout, you will see a section titled How Many Sidebars. This is your entry point to configuring this. What this lets you do is assign one layout by default to individual posts and pages, and force a dynamic view to adopt another layout.
Use Case: 2 Sidebars on the Blog Page, 1 on Category Views, 0 on Single Posts
To set this up, define the following options:
- Sidebar Configuration → Sidebar Layout → How Many Sidebars? → Default Views:
Set this to 0.
- Sidebar Configuration → Sidebar Layout → How Many Sidebars? → Blog Page:
Set this to Double Left – Will inherit settings of the "Double Left Sidebars" template, or whichever configuration you want to use.
- Sidebar Configuration → Sidebar Layout → How Many Sidebars? → Category Views:
Set this to Single Left – Will inherit settings of the "Single Left Sidebar" template, or whichever configuration you want to use.
- Other Graphical Elements → Sizes and Margins:
Set your widths for the content appropriately in this section. This will be used by your posts by default.
- Templates → Double Left Sidebars:
(Or whichever configuration you picked in #2 above)
Set your widths and dimensions appropriately. These will be used by your Blog Page now.
- Templates → Single Left Sidebar:
(Or whichever configuration you picked in #3 above)
Set your widths and dimensions appropriately. These will be used by your Category Views now.
That’s it. Your site will now show 0 sidebars for posts, but 2 for your Blog Page and 1 for your Categories.
What I have seen happen on the Support Forum is that users tend to do this:
- Sidebar Configuration → Sidebar Layout → How Many Sidebars? → Default Views: Set to 2.
- Sidebar Configuration → Sidebar Layout → How Many Sidebars? → Blog Page: Set to Double Left – Will inherit settings of the "Double Left Sidebars" template.
At this point if you set the Sizes and Margins in Other Graphical Elements → Sizes and Margins, they will not affect your main page, because it has been configured to use the Double Left Sidebars template in the second step above. Instead, all you need to do is set the Blog Page to Inherit default number of sidebars. That way you will have consistency.
Another related misconception I have seen is more fundamental – users tend to explicitly assign a template to every view (such as categories, date archives etc) and then wonder what they should do for views that are not available (like something introduced by a plugin). This is a case of over-complicating the problem. If you have established a specific layout to your default view (like 1 sidebar, with the first sidebar positioned left), you must not assign the “Single Left Sidebar” to individual templates – that is pointless unless you want different column widths. Instead let everything inherit the default layout. Conversely if you want a single left sidebar layout for every link in your site, simply set the default view to have 1 sidebar with the first sidebar positioned left. Don’t worry about assigning templates to everything else because they will all use the default layout.