[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentynineteen/template-parts/header/ -> site-branding.php (source)

   1  <?php
   2  /**
   3   * Displays header site branding
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Nineteen
   7   * @since Twenty Nineteen 1.0
   8   */
   9  ?>
  10  <div class="site-branding">
  11  
  12      <?php if ( has_custom_logo() ) : ?>
  13          <div class="site-logo"><?php the_custom_logo(); ?></div>
  14      <?php endif; ?>
  15      <?php $blog_info = get_bloginfo( 'name' ); ?>
  16      <?php $is_front = ! is_paged() && ( is_front_page() || ( is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) ); ?>
  17      <?php if ( ! empty( $blog_info ) ) : ?>
  18          <?php if ( is_front_page() && is_home() ) : ?>
  19              <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" <?php echo $is_front ? 'aria-current="page"' : ''; ?>><?php bloginfo( 'name' ); ?></a></h1>
  20          <?php else : ?>
  21              <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" <?php echo $is_front ? 'aria-current="page"' : ''; ?>><?php bloginfo( 'name' ); ?></a></p>
  22          <?php endif; ?>
  23      <?php endif; ?>
  24  
  25      <?php
  26      $description = get_bloginfo( 'description', 'display' );
  27      if ( $description || is_customize_preview() ) :
  28          ?>
  29              <p class="site-description">
  30                  <?php echo $description; ?>
  31              </p>
  32      <?php endif; ?>
  33      <?php if ( has_nav_menu( 'menu-1' ) ) : ?>
  34          <nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'twentynineteen' ); ?>">
  35              <?php
  36              wp_nav_menu(
  37                  array(
  38                      'theme_location' => 'menu-1',
  39                      'menu_class'     => 'main-menu',
  40                      'items_wrap'     => '<ul id="%1$s" class="%2$s">%3$s</ul>',
  41                  )
  42              );
  43              ?>
  44          </nav><!-- #site-navigation -->
  45      <?php endif; ?>
  46      <?php if ( has_nav_menu( 'social' ) ) : ?>
  47          <nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'twentynineteen' ); ?>">
  48              <?php
  49              wp_nav_menu(
  50                  array(
  51                      'theme_location' => 'social',
  52                      'menu_class'     => 'social-links-menu',
  53                      'link_before'    => '<span class="screen-reader-text">',
  54                      'link_after'     => '</span>' . twentynineteen_get_icon_svg( 'link' ),
  55                      'depth'          => 1,
  56                  )
  57              );
  58              ?>
  59          </nav><!-- .social-navigation -->
  60      <?php endif; ?>
  61  </div><!-- .site-branding -->


Generated : Sun Mar 9 08:20:01 2025 Cross-referenced by PHPXref