Skip to content Skip to sidebar Skip to footer

Underscores Wordpress Theme - Adding Second Sidebar

Stared a Wordpress site using Underscores theme (_s) I have got one sidebar working but want to make a second one to be on the same page. (containing different widgets) I have adde

Solution 1:

You'll need to edit the "sidebar.php" file in your theme folder. It should normally be:

<divid="secondary"class="widget-area"role="complementary"><?php do_action( 'before_sidebar' ); ?><?phpif ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?><?phpendif; // end sidebar-1 widget area ?></div><!-- #secondary -->

You will need to add another if statement that looks out for the other sidebar. Be sure to reference it by whatever you used in the functions.php file.

If you want it to appear below the current sidebar, just be sure to add it before closing the 'div' so it will still be in the same column. I used 'sidebar-lower':

<divid="secondary"class="widget-area"role="complementary"><?php do_action( 'before_sidebar' ); ?><?phpif ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?><?phpendif; // end sidebar-1 widget area ?><?phpif ( ! dynamic_sidebar( 'sidebar-lower' ) ) : ?><?phpendif; // end sidebar-lower widget area ?></div><!-- #secondary -->

Post a Comment for "Underscores Wordpress Theme - Adding Second Sidebar"