Modifying your sidebar contents


Sometimes you just can’t help but notice some things on your theme’s sidebar. Sometimes you do not really like the order of the information which could be found on your sidebar. Or maybe you would like to add or remove some things.

Let us look back on the White as Milk theme. There is a section for archives. If you would rather not have the Archives section at all, you could edit the sidebar template. The nice thing about WordPress is that you are focused on which part of the theme you are editing. In this case, it’s the sidebar.

The White as Milk theme has a section for Author/Blogger information. Would you like to use it? If so, then remove the indicators that comment it out. The indicators are the <!-- and the --> so that anything between those are hidden. After that, add the information about yourself in the filler part of the template.

Also, if you want your Archives part to appear somewhere, you have know what part of the template contains the information. In this case it’s this:
<li><h2><?php _e('Archives'); ?></h2>
<?php wp_get_archives('type=monthly'); ?>

The clue for us is that it says Archives. Within the section of Archives, you have the WordPress template tag which handles it quite easily for you.

You could move that to somewhere lower on your sidebar if you like. Maybe if your blog is more of a story blog and you'd like your visitors to read up the different categories rather than focus on the dates they have been posted, you could opt to do that.

If you're using sidebar widgets, you don't really have to mess with knowing what template tags are. After all, you would only have to drag and drop them from the panel. Customizing them is also possible through the dashboard so that shouldn't be too difficult. However, as I pointed out before, sometimes it's easier to mess around with template tags and such for one's sidebar because it's easier to control via CSS and stuff. Sometimes the widgets have their own styles and it could be quite problematic.


Originally posted on September 19, 2006 @ 12:16 am