This is really awesome. Many a times I have loved a theme, but I shy away from using it. Why? I know nothing about coding and I would prefer to have have widget ready themes. Over last couple of weeks, I have surely learnt that all plugin and widget ‘functionality’ lies in the functions.php!

Infact, last week I borrowed some cool functionality from one theme and massaged that into my other theme. Wow, it worked! So, here is a how-to for converting non-widget ready theme to a widget ready theme!

Functions.php is the file you should be looking for. Insert this code in the file

<?php
if ( function_exists(’register_sidebar’) )
register_sidebar();
?>

Now you need to modify your theme’s sidebar.php

Typically

<div id=”sidebar”>
<h2>Search this site</h2>
<div id=”searchdiv”>
<form id=”searchform” method=”get” action=”<?php echo $_SERVER[’PHP_SELF’]; ?>”>
<input type=”text” name=”s” id=”s” size=”20″/>
<input name=”sbutt” type=”submit” value=”Go” alt=”Submit” />
</form>
</div>
//
<?php if ( !function_exists(’dynamic_sidebar’)
|| !dynamic_sidebar() ) : ?> // added

//
<h2><?php _e(’Archives’); ?></h2>
<ul><?php wp_get_archives(’type=monthly’); ?></ul>
<h2><?php _e(’Categories’); ?></h2>
<ul><?php list_cats() ?></ul>
<h2><?php _e(’Meta’); ?></h2>
<ul>
<?php wp_register(); ?>
<li><a href=”<?php bloginfo(’rss2_url’); ?>”>RSS</a></li>
<li><?php wp_loginout(); ?></li>
</ul>
<?php wp_meta(); ?>
//
<?php endif; ?> // added
//
</div>

That’s it! You are all sorted mate to have a widget ready theme! Give it a shot. Its straight forward!

%d bloggers like this: