sidebar.php 806 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * The sidebar containing the main widget area.
  4. *
  5. * @package Gazette
  6. */
  7. if ( ! is_active_sidebar( 'sidebar-1' ) && ( ( 1 != get_theme_mod( 'gazette_author_bio' ) && ! get_the_author_meta( 'description' ) ) || ! is_single() ) ) {
  8. return;
  9. }
  10. ?>
  11. <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
  12. <button class="sidebar-toggle" aria-controls="secondary" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Sidebar', 'gazette' ); ?></span></button>
  13. <?php endif; ?>
  14. <div id="secondary" class="widget-area" role="complementary">
  15. <?php
  16. // Author Bio
  17. if ( 1 == get_theme_mod( 'gazette_author_bio' ) && get_the_author_meta( 'description' ) && is_single() ) {
  18. get_template_part( 'author-bio' );
  19. }
  20. // Sidebar
  21. dynamic_sidebar( 'sidebar-1' );
  22. ?>
  23. </div><!-- #secondary -->