WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/28/2014 09:02:02 PM (6 years ago)
Author:
iandstewart
Message:

Twenty Fifteen: Use a heading heirarchy to provide a better navigation experience when using screenreading software.

Props davidakennedy, rianrietveld, iamtakashi, afercia, davidakennedy, fixes #30065.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/header.php

    r30046 r30072  
    3030        <header id="masthead" class="site-header" role="banner">
    3131            <div class="site-branding">
    32                 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    33                 <p class="site-description"><?php bloginfo( 'description' ); ?></p>
     32                <?php
     33                    if ( is_front_page() && is_home() ) : ?>
     34                        <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
     35                    <?php else : ?>
     36                        <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
     37                    <?php endif;
     38
     39                    $description = get_bloginfo( 'description', 'display' );
     40                    if ( ! empty( $description ) ) : ?>
     41                        <p class="site-description"><?php echo esc_html( $description ); ?></p>
     42                    <?php endif;
     43                ?>
    3444                <button class="secondary-toggle"><?php esc_html_e( 'Menu and widgets', 'twentyfifteen' ); ?></button>
    3545            </div><!-- .site-branding -->
Note: See TracChangeset for help on using the changeset viewer.