Posted By

daprela on 06/25/14


Tagged

sidebar


Versions (?)

Add sidebar in template in WP


 / Published in: PHP
 

Add a sidebar to a WP template

  1. <?php
  2. /**
  3.  * The sidebar containing the footer widget area
  4.  *
  5.  * If no active widgets in this sidebar, hide it completely.
  6.  *
  7.  * @package WordPress
  8.  * @subpackage Twenty_Thirteen
  9.  * @since Twenty Thirteen 1.0
  10.  */
  11.  
  12. if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
  13. <div id="secondary" class="sidebar-container" role="complementary">
  14. <div class="widget-area">
  15. <?php dynamic_sidebar( 'sidebar-1' ); ?>
  16. </div><!-- .widget-area -->
  17. </div><!-- #secondary -->
  18. <?php endif; ?>

Report this snippet  

You need to login to post a comment.