WordPress is such a popular blogging application because it’s extremely flexible. It’s evolved and changed a great deal since the project was created, occasionally leading to addons and themes that are outdated.
Why Widgets?
One of the things that it seems every WordPress theme must have these days is areas where users can use widgets or small, predefined pieces of code that users can use to add custom functionality to their site. On this site I use one to list my recent tweets and another to display design bookmarks, a third links to my recent posts. Widgets are so popular because they make personalized coding easy for users. I didn’t have to worry about any PHP or javascript to use them once I set up the widget sidebar.
How’s it Done?
- First you create a file called functions.php in the theme folder.
- Then you paste in the following code:
'Widget Bar', 'before_widget' => ' <li>', 'after_widget' => '</li> ', 'before_title' => ' <h3>', 'after_title' => '</h3> ', ));?>- If you’re only putting in one sidebar, you don’t have to name it but it makes it easier to keep them straight if you have multiple ones. I use two. One for my index page and one for the rest of my site.
- To make a second (or more) sidebar, just duplicate the code and give it a different name.
- The html can be modified to whatever you need.
- Now you just need to insert the sidebar wherever you want the widgets to show up (not strictly in the site’s sidebar). Just paste this code where you want the widgets, changing the name to the one you gave it in the functions.php file.
<ul></ul>

That’s it! Just install the widgets you want as plugins and set them up under the Appearance pane.


Print This!
Posts





Twitter
delicious
Linked In
StumbleUpon
Google Shared Items
No Comments on "How to make a widget sidebar in WordPress"