Mar 032011
 
How To

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:

  1. Create a new static page.
  2. Assign it a template like Single Left, Single Right Sidebar from the right side of your Add Page or Edit Page screen.
  3. 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:

  1. Sidebar Configuration → Sidebar Layout → How Many Sidebars? → Default Views:
    Set this to 0.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.

Misconceptions

What I have seen happen on the Support Forum is that users tend to do this:

  1. Sidebar Configuration → Sidebar Layout → How Many Sidebars? → Default Views: Set to 2.
  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.

  6 Responses to “Using the New Sidebar Control Features from Version 3.7.7”

Comments (6)
  1. This post really helped me! I modified the Theme in the with to 1200 instead of 1000 with another with of the sidebars. I could not manage to get the post view to look like the main page. Now everything looks like it should. I wish i had read your post before instead of trying several hours. Thanks a lot!

     
  2. Hi Sayontan,

    As usual, amazed with your theme! Been using it for some time and love it.

    I do have one hangup in regards to the templates and the above. I understand it all, but what I don’t understand is how to set a default post template. As it is the author can select the single left, single right template when making a post, but I’d like to set that as the default for all posts, simply because our client will never remember to select this when making posts and will then gripe that the layout of the site is incorrect.

    Can you point me in the right direction? Thanks!

     
    • The answer is in the Misconceptions section above. You basically set the Default Views to have a certain number of sidebars, then position the sidebars on the correct side by going to Sidebars → Sidebar 1 and Sidebars → Sidebar 2. That’s all. You must not assign individual templates to any other page – that will give you wrong results.

       
      • Sayontan, you are a genius! Thank you so much for the clarification and quick response! The part I have been missing is the positioning of the sidebars under sidebar 1, sidebar 2, etc.

        Keep up the great work!

         
  3. So I’ve read this article very carefully, and I still can’t get the widths for sidebars or content to change. I’ve spent hours and have gotten nowhere. Please help.
    Nathan

     
  4. Please someone help:
    My right sidebar is lost on my pages but i still have the mainpage sidebar.

    Any help is apprciated.

     

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*