Customizing your Wordpress Sidebar

Customizing Wordpress Sidebar

I’ve had some people asking me how did I customize the right sidebar of my blog, from the RSS Feed link at the top till the categories below. I’m writing this article to try to help you achieve something like I did on Paintbits on your Wordpress Blog.


Sidebar
Sidebar by Nicholas T.

Before I begin with the tips, let me tell you that all that I’m writing here is not rocket science. All of this is simple CSS, I didn’t read any guide to do it, just looked at the generated Wordpress HTML code and applied a bit of CSS to change the look of the sidebar to fit my taste. The CSS used is also very simple, nothing fancy, everything comes in the manual! ;) With that said, let’s start.

RSS Feed Link with a Rollover Image

Making an RSS Feed Link using an Image to create a Rollover effect, just like you can achieve using Javascript is very easy, it only takes a bit of CSS.

I’m using K2 theme with a style made by me so some things might be different if you use another theme. K2 replaces the Widget system with a different system so the code generated for the widgets is slightly different. Using K2, I created a new Text, HTML and PHP Widget (that allows you to write HTML and PHP), positioned it at the top with the following code inside:


<a id="rss_sidelink" href="http://feeds.feedburner.com/Paintbits"
title="Subscribe to my RSS Feed"></a>

As you can see it’s a simple link to the Feed with a CSS ID, in this case rss_sidelink.

Now to achieve the Rollover effect you need an image containing the 2 States. You can see the image I used below as example.

RSS Feed Rollover Image

Now to make the Image change we just add a bit of CSS, I’ll show you what I used here on paintbits.


#rss_sidelink
{
height: 60px;
width: 230px;
text-indent: 10000px;
overflow: hidden;
background: url(/wp-content/themes/k2/styles/lumen/images/rss.jpg)
top left no-repeat;
display: block;
}

#rss_sidelink:hover
{
background-position: bottom left;
}

Styling the Sidebar Widgets

With the RSS Feed Image done let’s focus on the other Widgets. I’ll give you one example using the Popular Posts Widget. K2 brings its own Popular Posts Widget, if it isn’t the case with your theme, you can find one easily in Wordpress Plugin Directory. Anyway this is just the main idea, you can apply the same styling to the other widgets as their HTML is very similar.

Moving on…

Design a nice Image to serve as header for your Widgets, or simply add a custom text. I went with an image, you can see it below or on my sidebar.

Popular Posts Header Image

Let’s look at the Wordpress HTML generated code (take into consideration that my Widget structure might be slightly different from yours due to the use of K2 in my blog).


<div id="popular" class="widget module module5 WPPP_print_widget">
<ul class='wppp_list'>
	<li></li>
	<li></li>
	<li></li>
</ul>
</div>

The structure of all Widgets using K2 is all fairly simple. They are simple Unordered Lists (UL) with a specific class (in this case wppp_list) with several List Items (li) enclosed in a div (id=”popular” class=”widget module module5 WPPP_print_widget”).

So, to modify it’s appearance we just create some CSS styling this specific classes. The same can be done to the other classes generated in the other Widgets (like the Tag Cloud, Post Categories, etc…).


#popular
{
background: url('http://www.paintbits.com/Imagens/tags_pp.png')
top left no-repeat;
}

#popular .wppp_list

{
padding-top:40px;
}

#popular .wppp_list li

{
border-bottom: 1px dotted #21303b;
{

With this little guide I hope I gave you a fairly idea on how to style your Wordpress sidebar. Now be creative, create something unique. Your imagination is the limit… ;)

If you like this entry, consider bookmarking it to help us.

StumbleUpon | del.icio.us | Digg | Technorati | Facebook

11 Responses to “Customizing your Wordpress Sidebar”


  1. 1 Lmsm

    Hey, óptimo post ! :D Vai-me ajudar bastante num futuro próximo.
    Parabéns ! :)
    Abraços

  2. 2 edumicro

    Bom artigo, gostava é de saber como adicionas esses banners (Subscrive RSS e Bookmark) no final dos posts (é com algum plugin?)…

    Cumps

  3. 3 freedy

    Outro bom artigo!

    Tenho a mesma dúvida que o edumicro… :(

  4. 4 freedy

    Olha podes me explicar como criaste o widget Text,HTML e PHP?!? Não entendi essa parte :S

  5. 5 greven

    Ok. A cena no final dos posts é algo à parte, não é nenhum plugin, fui eu mesmo que programei e meti dentro do template.

    Quanto à Text. HTML e PHP como disse é um Widget de texto que faz parte do K2 Theme. Agora se utilizam o sistema normal de Widgets deve haver um Text Widget e deve fazer o mesmo efeito. :)

  6. 6 Filipe

    excelente tut greven!

  7. 7 Rod

    Very nice look. I do find the white on black attractive, but a little hard on the eyes (maybe it’s just my age;-) ). I had a similar need recently to widen my K2 sidebar, and initially thought it would be hard, but like you found that once I got started it was quite straightforward.

    Rods last blog post… No thank you, I don’t need penis enlargement

  8. 8 greven

    @Rod - I will probably have to do the same, Rod. Widen the sidebar.

    Thank you for your comment. :)

  9. 9 sundyme

    nice tutorial?

    sundymes last blog post… ???????

  10. 10 createmo

    Thank you for your website :-)
    I made with photoshop backgrounds for myspace,youtube and ect..
    my backgrounds:http://tinyurl.com/5b8ksl
    have a great day and thank you again!

  1. 1 Photoshop Tutorials you should see… at Paintbits - Life in Colors

Leave a Reply