How to add a sidebar in Twenty Eleven theme

A few weeks before the WordPress 3.2 general release came out, we linked up a beta copy of the Twenty Eleven theme with a download link so our readers could preview it on pre 3.2 sites.

And no doubt many of you have updated to WordPress 3.2 by now. And some of you may have noticed that Twenty Eleven for whatever strange reason doesn’t have a sidebar widget area on the inner pages?!

It’s one of those “what were they thinking?” questions we like to cynically ask.

Kevin Muldoon and Bart Surminski to the rescue as Kevin outlines around 4 steps to easily add the sidebar to Twenty Eleven theme on his WPMods.com site. This could be a great exercise if you’re a confident beginner who wants to hack a theme for the first time.

But if you just want the modified theme pre-baked, there’s also a link by Niraj in the comments section of that article so you can grab a copy of the theme with the widget enabled.

Visit: WPMods.com

Quick Tip: Add excerpts to search results page

If you’ve tried searching for a keyword on a WP site, you may have noticed that the search results don’t always include an excerpt of matching page(s). While you’re at it, have you tried the search function on your site? The missing excerpt is not WordPress’s fault, in reality the theme designer neglected or chose not to include that feature in the theme.

Here’s how to quickly add an excerpt to your search results page by hacking your theme. Important: make sure you have a copy of your original theme and/or backup the existing search.php page ready to restore in case you get in trouble. We’re not responsible if you muck up your site.

In WordPress admin, select Appearance -> Editor -> Search.php (screenshot below) Add the following tag after the end of the headline tag, usually </h2>:

<?php the_excerpt(); ?>

And hit “Save” and go try a search on your site!

the_excerpt_wordpress_code.jpg

Another tip, now that you’ve improved it with excerpts,  why not improve it further by trying Relevanssi plugin? Relevannsi will help bump up the quality of matching results. You’ll still need to  do a bit of work tagging your posts or pages but it’s worth it.