WP Framework Forums » General Discussion

Adding a second sidebar to wpframework theme

(2 posts)
  • Started 1 day ago by bancomdesign
  • Latest reply from ptahdunbar
  1. bancomdesign

    I have tried to add a second dynamic sidebar to the theme but I cant get it to work properly. Does anybody have any step by step instructions on how to do this?

    Posted 1 day ago #
  2. ptahdunbar
    Framework Overlord

    What version of WP Framework are you using?

    Using the latest stable version of WP Framework 0.2.3, here's how that works.

    First, you want to change this line found in functions.php
    define( 'REGISTER_WIDGETS', 1 );
    Change the 1 to the number of widgets you'd like to add.

    Next, you add dynamic_sidebars() to your templates. e.g.

    <?php /* Widgetized Area */
    if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar() ) : ?>
    <!-- you can have stuff display here by default. if not, just leave this blank. -->
    <?php endif; /* (!function_exists('dynamic_sidebar') */ ?>

    You add those to your template based on the number of widgets you'd like to add.

    And that's it. Check the widgets panel and you should see all the new widgets show up.

    Now if you'd like to customize the output of the widgets, simply add this to your custom-functions.php:

    function register_widgets() {
    register_sidebars( REGISTER_WIDGETS, array(
    'before_widget' => '<div id="%1$s" class="widget %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',

    And there you go.

    Posted 21 hours ago #

RSS feed for this topic


You must log in to post.