sidebar.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. // Primary navigation menu.
  15. wp_nav_menu( array(
  16. 'menu_class' => 'nav-menu',
  17. 'theme_location' => 'primary',
  18. ) );
  19. ?>
  20. </nav><!-- .main-navigation -->
  21. <?php endif; ?>
  22. <?php if ( has_nav_menu( 'social' ) ) : ?>
  23. <nav id="social-navigation" class="social-navigation" role="navigation">
  24. <?php
  25. // Social links navigation menu.
  26. wp_nav_menu( array(
  27. 'theme_location' => 'social',
  28. 'depth' => 1,
  29. 'link_before' => '<span class="screen-reader-text">',
  30. 'link_after' => '</span>',
  31. ) );
  32. ?>
  33. </nav><!-- .social-navigation -->
  34. <?php endif; ?>
  35. <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
  36. <div id="widget-area" class="widget-area" role="complementary">
  37. <?php dynamic_sidebar( 'sidebar-1' ); ?>
  38. </div><!-- .widget-area -->
  39. <?php endif; ?>
  40. </div><!-- .secondary -->
  41. <?php endif; ?>