This weekend I had a project. [NOTE: This article was originally written in 2012 and for some reason I neglected to hit Publish. So “this weekend” was actually some time ago 8=] It was time to take the site for my wife’s business (one of 2, actually) and bring it out of the stone age.
The site was originally put together in 2001 and I built it from scratch with HTML/CSS. Along the way I added some PHP functions to make the menus. It was a nice site, but it was seriously dated. Not to mention difficult to add or edit content.
So I installed WordPress, setup the new pages to replicate the site and added the redirects into the .htaccess file so the old URL’s would match up to the new pages.
Then I got to work building a child theme. I decided to base it on Twenty Eleven — the latest and greatest from the WordPress team. But it wasn’t until I got things half way done that I noticed that there were no sidebars.
WTF? Where are the sidebars? I couldn’t figure out what I’d messed up. I checked the CSS. I looked at the .php files. Finally it dawned on me that I hadn’t messed up. The fact is that pages and posts come without sidebars by default!
Now, I have no idea who came up with this design, but it sure doesn’t make sense to me. How many of us don’t want sidebars on our pages or posts? Wouldn’t the need for a page without them be in the minority? If it was up to me I’d make the sidebar enabled template the default. But it isn’t up to me.
In order to see sidebars for pages you need to use the Sidebar Template rather than the default. I’m not sure how you’d go about it for single posts.
Another option is to override the templates for pages and posts in the child theme, adding get_sidebars() just before the footer.
However, I stumbled upon a plugin that can help. Twenty Eleven Extensions adds several features to the Twenty Eleven theme and it’s children. One of them is adding the sidebar to all posts and/or pages.
I still ended up using the Sidebar Template for pages since I don’t want the sidebar on every page, but the plugin allowed me to set up the sidebar for all the posts.