Posted @ 2:37 pm
Today’s Topic: Widgitize The Sidebar
In order to ad widgets to a sidebar, we must undergo a few simple steps in order to widgetize the theme, assuming the theme isn’t already widget-ready. The first step is to take a look at your sidebar setup. Ours is:
So to facilitate this, we create a functions.php template file and include the following in it:
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '<li>',
'after_widget' => '</div></li>',
'before_title' => '<div class="sbartitle">',
'after_title' => '</div><div style="margin-right:10px">',
));
?>
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '<li>',
'after_widget' => '</div></li>',
'before_title' => '<div class="sbartitle">',
'after_title' => '</div><div style="margin-right:10px">',
));
?>
Once this is setup, I placed the following code where her sidebar should be (after the <ul> tag):
Then right before the </ul> tag:
<?php endif; ?>
And viola! Add the widgets and that’s that! If you want some items to appear in the sidebar before the widgets (without using the text widget), just add those items before the above code right after the <ul> tag.
| 2.5 |
Rate this post:
Related Posts
- Wordpress Tutorial: Creating A Sidebar Part One
- Wordpress Tutorial: Creating A Sidebar Part Two
- Wordpress Tutorial: Creating A Sidebar Part Three
- Working On The Woolly Mom
- Wordpress 2.6 Now Available!
∫
Categories: Design / Maintenace • Running a Website
Tags: Design • Widgets • woolleymom.com • Wordpress
Previous Post:
One Hundred And One Posts Later…And WoollyMom Updates
Next Post:
phpBB2 Forum CounterSpam Measures




Bradford
















No comments yet.