[ 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 if ( ! empty( $blog_info ) ) : ?>
  17          <?php if ( is_front_page() && is_home() ) : ?>
  18              <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  19          <?php else : ?>
  20              <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  21          <?php endif; ?>
  22      <?php endif; ?>
  23  
  24      <?php
  25      $description = get_bloginfo( 'description', 'display' );
  26      if ( $description || is_customize_preview() ) :
  27          ?>
  28              <p class="site-description">
  29                  <?php echo $description; ?>
  30              </p>
  31      <?php endif; ?>
  32      <?php if ( has_nav_menu( 'menu-1' ) ) : ?>
  33          <nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'twentynineteen' ); ?>">
  34              <?php
  35              wp_nav_menu(
  36                  array(
  37                      'theme_location' => 'menu-1',
  38                      'menu_class'     => 'main-menu',
  39                      'items_wrap'     => '<ul id="%1$s" class="%2$s">%3$s</ul>',
  40                  )
  41              );
  42              ?>
  43          </nav><!-- #site-navigation -->
  44      <?php endif; ?>
  45      <?php if ( has_nav_menu( 'social' ) ) : ?>
  46          <nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'twentynineteen' ); ?>">
  47              <?php
  48              wp_nav_menu(
  49                  array(
  50                      'theme_location' => 'social',
  51                      'menu_class'     => 'social-links-menu',
  52                      'link_before'    => '<span class="screen-reader-text">',
  53                      'link_after'     => '</span>' . twentynineteen_get_icon_svg( 'link' ),
  54                      'depth'          => 1,
  55                  )
  56              );
  57              ?>
  58          </nav><!-- .social-navigation -->
  59      <?php endif; ?>
  60  </div><!-- .site-branding -->


Generated : Tue Mar 19 08:20:01 2024 Cross-referenced by PHPXref