WordPress.org

Make WordPress Core

Changeset 40458


Ignore:
Timestamp:
04/17/2017 10:08:55 AM (15 months ago)
Author:
swissspidy
Message:

Twenty Seventeen: Correct heading hierarchy for posts on the front page.

When the posts page is on the front page or within a front page section, the heading hierarchy for the individual post titles needs to be adjusted accordingly.

Props joedolson, celloexpressions, davidakennedy.
Fixes #40264.

Location:
trunk/src/wp-content/themes/twentyseventeen
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/style.css

    r39942 r40458  
    452452}
    453453
    454 h2 {
     454h2,
     455.home.blog .entry-title {
    455456    color: #666;
    456457    font-size: 20px;
     
    31543155
    31553156    h2,
     3157    .home.blog .entry-title,
    31563158    .page .panel-content .recent-posts .entry-title {
    31573159        font-size: 26px;
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php

    r39618 r40458  
    3434            if ( is_single() ) {
    3535                the_title( '<h1 class="entry-title">', '</h1>' );
     36            } elseif ( is_front_page() && is_home() ) {
     37                the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
    3638            } else {
    3739                the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php

    r39618 r40458  
    3131        <?php endif; ?>
    3232
    33         <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
     33        <?php if ( is_front_page() && ! is_home() ) {
     34
     35            // The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2.
     36            the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' );
     37        } else {
     38            the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
     39        } ?>
    3440    </header><!-- .entry-header -->
    3541
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php

    r39618 r40458  
    3434        if ( is_single() ) {
    3535            the_title( '<h1 class="entry-title">', '</h1>' );
     36        } elseif ( is_front_page() && is_home() ) {
     37            the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
    3638        } else {
    3739            the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/post/content-image.php

    r39618 r40458  
    3434            if ( is_single() ) {
    3535                the_title( '<h1 class="entry-title">', '</h1>' );
     36            } elseif ( is_front_page() && is_home() ) {
     37                the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
    3638            } else {
    3739                the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php

    r39618 r40458  
    3434            if ( is_single() ) {
    3535                the_title( '<h1 class="entry-title">', '</h1>' );
     36            } elseif ( is_front_page() && is_home() ) {
     37                the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
    3638            } else {
    3739                the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/post/content.php

    r39618 r40458  
    3434        if ( is_single() ) {
    3535            the_title( '<h1 class="entry-title">', '</h1>' );
     36        } elseif ( is_front_page() && is_home() ) {
     37            the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
    3638        } else {
    3739            the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
Note: See TracChangeset for help on using the changeset viewer.