WordPress.org

Make WordPress Core

Changeset 30072


Ignore:
Timestamp:
10/28/2014 09:02:02 PM (4 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.

Location:
trunk/src/wp-content/themes/twentyfifteen
Files:
9 edited

Legend:

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

    r30046 r30072  
    2525    </div><!-- .author-avatar -->
    2626    <div class="author-description">
    27         <h2 class="author-title"><?php echo get_the_author(); ?></h2>
     27        <h3 class="author-title"><?php echo get_the_author(); ?></h3>
    2828        <p class="author-bio">
    2929            <?php the_author_meta( 'description' ); ?>
  • trunk/src/wp-content/themes/twentyfifteen/content-link.php

    r30046 r30072  
    1515
    1616    <header class="entry-header">
    17         <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h1>' ); ?>
     17        <?php
     18            if ( is_single() ) :
     19                the_title( sprintf( '<h1 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h1>' );
     20            else :
     21                the_title( sprintf( '<h2 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h2>' );
     22            endif;
     23        ?>
    1824    </header>
    1925    <!-- .entry-header -->
  • trunk/src/wp-content/themes/twentyfifteen/content-search.php

    r30046 r30072  
    1515
    1616    <header class="entry-header">
    17         <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
     17        <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
    1818    </header><!-- .entry-header -->
    1919
  • trunk/src/wp-content/themes/twentyfifteen/content.php

    r30046 r30072  
    1919                the_title( '<h1 class="entry-title">', '</h1>' );
    2020            else :
    21                 the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' );
     21                the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
    2222            endif;
    2323        ?>
  • trunk/src/wp-content/themes/twentyfifteen/functions.php

    r30053 r30072  
    120120        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    121121        'after_widget'  => '</aside>',
    122         'before_title'  => '<h1 class="widget-title">',
    123         'after_title'   => '</h1>',
     122        'before_title'  => '<h2 class="widget-title">',
     123        'after_title'   => '</h2>',
    124124    ) );
    125125}
  • 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 -->
  • trunk/src/wp-content/themes/twentyfifteen/inc/template-tags.php

    r30046 r30072  
    3535    ?>
    3636    <nav class="navigation pagination" role="navigation">
    37         <h1 class="screen-reader-text"><?php esc_html_e( 'Posts navigation', 'twentyfifteen' ); ?></h1>
     37        <h2 class="screen-reader-text"><?php esc_html_e( 'Posts navigation', 'twentyfifteen' ); ?></h2>
    3838        <div class="nav-links">
    3939            <?php echo $links; ?>
     
    7272    ?>
    7373    <nav class="navigation post-navigation" role="navigation">
    74         <h1 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'twentyfifteen' ); ?></h1>
     74        <h2 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'twentyfifteen' ); ?></h2>
    7575        <div class="nav-links">
    7676            <?php
     
    9999    ?>
    100100    <nav class="navigation comment-navigation" role="navigation">
    101         <h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'twentyfifteen' ); ?></h1>
     101        <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'twentyfifteen' ); ?></h2>
    102102        <div class="nav-links">
    103103            <?php
  • trunk/src/wp-content/themes/twentyfifteen/index.php

    r30046 r30072  
    2222
    2323        <?php if ( have_posts() ) : ?>
     24
     25            <?php if ( is_home() && ! is_front_page() ) : ?>
     26                <header>
     27                    <h1 class="page-title screen-reader-text"><?php echo esc_html( get_the_title( get_option( 'page_for_posts' ) ) ); ?></h1>
     28                </header>
     29            <?php endif; ?>
    2430
    2531            <?php while ( have_posts() ) : the_post(); ?>
  • trunk/src/wp-content/themes/twentyfifteen/style.css

    r30053 r30072  
    12851285    font-size: 22px;
    12861286    font-size: 2.2rem;
     1287    font-weight: 700;
    12871288    line-height: 1.3636;
     1289    margin-bottom: 0;
    12881290}
    12891291
Note: See TracChangeset for help on using the changeset viewer.