Now, we can move along to adding WordPress-generated content in the sidebar. Essentially, this part of our work is pretty simple. All we have to do is include some WordPress functions that will handle displaying various bits of dynamic content. In this case, it is the categories, tags, and archives.
Starting at the top, include the following piece of code in the sidebar area:
<div id="secondary" class="widget-area" role="complementary"> <?php if(is_active_sidebar('sidebar-1')) dynamic_sidebar('sidebar-1' ); ?> </div><! - #secondary - >
This code takes care of displaying whatever widgets have been assigned to that particular widget area. Placing widgets in the sidebar of your HTML structure is the easiest, and probably the most usable way, of widget-enabling your theme. Also, WordPress will take care of actually displaying everything properly, so you don't have to worry about any weird-looking elements on your site. For instance, every menu is displayed as a <ul> list, and every menu element is inside <li>. This is as in tune with the standards as it can be.