A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

WordPress: How to enable widgets in your custom theme

This is probably in the WordPress documentation but to enable widgets in your own customized theme, do this:

... rest of PHP and HTML code in your here ...
<div id="sidebar">
    <ul>
        <?php if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
            <li> id="gray_box">
                <?php get_search_form(); ?>
            </li>
        <?php endif; ?>
    </ul>
</div>

After doing that, go to your WP-Admin page and drag-and-drop widgets. The widgets page is found in Appearance > Widgets .

This entry was posted in General. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>