sidebar.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * The sidebar containing the main widget area.
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Fifteen
  7. * @since Twenty Fifteen 1.0
  8. */
  9. if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( 'sidebar-1' ) ) : ?>
  10. <div id="secondary" class="secondary">
  11. <?php if ( has_nav_menu( 'primary' ) ) : ?>
  12. <nav id="site-navigation" class="main-navigation" role="navigation">
  13. <?php
  14. wp_nav_menu( array(
  15. 'menu_class' => 'nav-menu',
  16. 'theme_location' => 'primary',
  17. ) );
  18. ?>
  19. </nav><!-- .main-navigation -->
  20. <?php endif; ?>
  21. <?php if ( has_nav_menu( 'social' ) ) : ?>
  22. <nav id="social-navigation" class="social-navigation" role="navigation">
  23. <?php
  24. wp_nav_menu( array(
  25. 'theme_location' => 'social',
  26. 'depth' => 1,
  27. 'link_before' => '<span class="screen-reader-text">',
  28. 'link_after' => '</span>',
  29. ) );
  30. ?>
  31. </nav><!-- .social-navigation -->
  32. <?php endif; ?>
  33. <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
  34. <div id="widget-area" class="widget-area" role="complementary">
  35. <?php dynamic_sidebar( 'sidebar-1' ); ?>
  36. </div><!-- .widget-area -->
  37. <?php endif; ?>
  38. </div><!-- .secondary -->
  39. <?php endif; ?>