Styling the Thesis Sidebar

May 4, 2010

in Guides

Style Thesis Sidebars

How to style the Thesis sidebar is something I find being asked a lot when it comes to customizing the Thesis WordPress theme. I think this is because the classes are kind of hidden, as in there’s not much documentation of them, and changing your sidebar look is a great way to start differentiating your site from all the others out there.

I’ve decided to prepare this little guide on styling Thesis sidebars, and after you read it you should hopefully be able to do whatever you want with it. I’ve separated it into three sections: classes, hooks, and the multimedia box. This will allow you to alter the look of your sidebars, do cool things in them, and take advantage of a function already created for you.

I hope you enjoy and find this quick guide useful.


Classes

Classes are what you’ll change to alter the look of your sidebars. These are all pre-applied to your theme out of the box, so you’ll need to put them in custom.css and prepend .custom before them and boom! Your sidebars will be full of flare and personal charm in no time.

li.widget – This is each individual widget. If say you wanted your widgets a different colour than the rest of your sidebar, you’d add a background to this class.

.custom li.widget h3 – This is the header of each widget and one that people frequently like to change. For example you could add a background or if you want to get rid of the small-caps that every Thesis site has, you could put font-variant: normal;.

li.widget ul li – I put this here because people frequently use lists in their sidebars and using this class you can change how list items appear. Adding an underline for example, or changing how your category links appear.

#content_box and #content – These classes are used to perform the number one customization I see asked about when it comes to Thesis, and that is: how to change your sidebar colour. Editing these two classes together will give you a different background colour for your sidebars all the way to the bottom of the page. Use the following, where #content_box is your desired content colour and #content is your main background.

.custom #content_box {background-color: #eee; }
.custom #content {background-color: #fff;}

Hooks

This information can be found in the official Thesis Hooks Reference List, but I thought I’d add it to this guide as well. Using these hooks in your functions will let you do some cool things in your sidebars, such as add widgets that span both columns or put in advertisements.

thesis_hook_before_sidebars – Before your sidebars; spans both columns.

thesis_hook_after_sidebars – After your sidebars; spans both columns.

thesis_hook_multimedia_box – Inside your multimedia box, which you can read more about below.

thesis_hook_after_multimedia_box – After your multimedia box and before your sidebar widgets.

You can also use thesis_hook_before_sidebar_1, thesis_hook_after_sidebar_1, thesis_hook_before_sidebar_2 and thesis_hook_after_sidebar_2 if you want to hard-code something above or below one of the sidebars.

Multimedia Box

The multimedia box sits above your sidebars on the right and is pretty self-explanatory, I just want to make sure you know it’s there and what it’s capable of, which is essentially anything. You can find the options for the multimedia box under Design Options and there you can decide what to put in it. You can use it for a picture slideshow or an embedded video, or you can use “Custom Code” to really think outside of the box (ha). You can also widgetize it if you so feel.

That’s about it. I hope if you learned something from this little guide here. If you have any further questions about styling the Thesis sidebar feel free to ask in the comments.

photo by glenn harper

Thesis Theme for WordPress:  Options Galore and a Helpful Support Community

You'll notice this site talks about the Thesis theme for Wordpress. Don't know what the heck that is? Find out.

{ 6 comments… read them below or add one }

Jon July 11, 2010 at 1:21 am

I wanted to change the colors of my sidebar(s). So I cut and pasted the code from this post, but I seem to have done something wrong as it changed part of the middle column too (only part of it as well). Any idea what I did wrong? Thanks. Jon

Reply

Matt Dunn September 10, 2010 at 3:36 pm

That depends on what else you have defined in your stylesheet. All that code does is add a background to the page (including sidebar), and then adds a colour on top of the content.

Reply

Melody Sharp September 5, 2010 at 4:05 pm

Hi, Many thanks for this code. I’ve searched for it and this looks like the easiest solution. One problem I have, however, is that it changes the background color below the content, too. As in here:
http://www.mia-mobi.com/contact-us/

Do you have a fix for that?

Reply

Matt Dunn September 10, 2010 at 3:36 pm

Do you mean your footer is the same colour too? If so, add a colour to your footer. If not, I’m not sure what you’re referring to as the site looks fine to me.

Reply

Mark Hockenberry September 17, 2011 at 3:07 pm

Thanks Matt, awesome site!
I wondered how to have the sidebar background go all the way to the footer, this works great. I’m still new to css and your site has alot of good tutorials for customizing Thesis. I’ll get your rss feed on my sidebar for reference.

Reply

John January 14, 2012 at 8:30 pm

Love the styling of your headers in your widgets on this page. Would you be able to give some tips on how to get that look? I can’t get my header background color to span the entire width of my column.

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: