site-branding.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Displays header site branding
  4. *
  5. * @package Seedlet
  6. * @since 1.0.0
  7. */
  8. $blog_info = get_bloginfo( 'name' );
  9. $description = get_bloginfo( 'description', 'display' );
  10. $show_title = ( true === get_theme_mod( 'display_title_and_tagline', true ) );
  11. $header_class = $show_title ? 'site-title' : 'screen-reader-text';
  12. ?>
  13. <?php if ( has_custom_logo() && $show_title ) : ?>
  14. <div class="site-logo"><?php the_custom_logo(); ?></div>
  15. <?php endif; ?>
  16. <div class="site-branding">
  17. <?php if ( has_custom_logo() && ! $show_title ) : ?>
  18. <div class="site-logo"><?php the_custom_logo(); ?></div>
  19. <?php endif; ?>
  20. <?php if ( ! empty( $blog_info ) && $show_title ) : ?>
  21. <?php if ( is_front_page() && is_home() ) : ?>
  22. <h1 class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo $blog_info; ?></a></h1>
  23. <?php else : ?>
  24. <p class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo $blog_info; ?></a></p>
  25. <?php endif; ?>
  26. <?php endif; ?>
  27. <?php if ( ( $description || is_customize_preview() ) && $show_title ) : ?>
  28. <p class="site-description">
  29. <?php echo $description; ?>
  30. </p>
  31. <?php endif; ?>
  32. </div><!-- .site-branding -->