<?php
/* the following goes into the functions.php file */
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'My Custom Widget',
'id' => 'my_custom_widget',
'description' => 'Widget area for home page center left column',
'before_widget' => '<div id="widget-id" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
?>
<?php
/* this goes into your template file where you want the widget to appear */
?>
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('my_custom_widget')) : else : ?>
<div class="widget">
<h2>Widget Ready</h2>
<p>This my_custom_widget is widget ready! Add one in the admin panel.</p>
</div>
<?php endif; ?>