Vensure

Enabling Widgets in WordPress Themes

There are many awesome WordPress themes available for free use. Unfortunately, a large number of them do not have sidebar widget support. Sidebar widgets can be extremely useful for bloggers wishing to include additional content on their site such as lifesteam, thumbnails, or even a task as simple as rearranging the order of sidebar navigation links.  By chance, there are only a few simple steps involved in enabling sidebar widgets, which it would be to ones advantage to know.

The only files that need to be edited at all are functions.php, sidebar.php, and style.css. All of these files will be found within the appropriate theme directory (/wp-content/themes/themename).

Now open functions.php and at the top of the file include

<?php

if ( function_exists(‘register_sidebar’) )

register_sidebar();

?>

At this point save the file and upload it to the server. If at any point a window prompting an overwrite pops up, overwrite the existing file only after making a backup.

Now open up sidebar.php  and at the top of this file include

<div id=”sidebar”>
<div id=”sidelist”>
<ul>
<?php if ( !function_exists(‘dynamic_sidebar’)
|| !dynamic_sidebar() ) : ?>
<li></li>
<?php endif; ?>
</ul>
</div>
</div>

Then save sidebar.php and upload it to the server.

Now all that is left to do is edit the style.css adding #sidebar and #sidelist and styling the sidebar in an appropriate way to suit the theme the widgets are being enabled in. Happy Blogging!


Tags: , , ,

 
 
 

Leave a Reply

null - Vensure