Do  you know how to add wordpress sidebar widget?
Wordpress have a sidebar and widgets feature. This feature allow us to easily put something in our blogs. We can put Ads, search box, bookmarks button, chatbox, video, rss and etc in the sidebar. Managing those widgets is also fun because of the interactive interface. We can drag n drop to arrange our blog widgets easily.
But, If you make your own wordpress theme, you may find out that thesidebar widgets function is not enabled by default. If you try to manage widgets in “Dashboard -> Design -> Widgets“, you may see this following text.

It’s not enabled because of the compatibility issue with older version. But don’t worry, the guys who are behind the wordpress engine make it as easy as possible to enable and add wordpress sidebar widgets. They did a good job and It’s very easy to enable the widget and sidebar.
There’s only 2 steps to enable the dynamic sidebar
- Make a file named function.php and put
register_sidebars(number_of_sidebar_wanted); - Show the sidebar by putting on index.php
dynamic_sidebar(sidebar_number);
For example, I want to add 1 side-bar. Then this is how i do it:
- function.php
<?php register_sidebars(1); ?> - index.php
<div id="sidebar">
<ul><?php dynamic_sidebar(1);?></ul>
</div>
And finally, to make the sidebar live in our blog, we must fix the sidebar position. This is easily done by CSS floating the content at right and floating the sidebar at left or vice versa.
style.css
#content {
float:right;
width: 500px;
}
#sidebar {
float: left;
width: 200px;
border-right: 1px dashed #ccc;
margin-left: 20px;
}
#sidebar li {
list-style-type: none;
}
Now you have a sidebar and you can use the widget menu on your Wordpress Admin ![]()

Â
Popularity: 10% [?]
Related posts:
