Make WordPress Core

Ticket #40264: 40264.diff

File 40264.diff, 1.0 KB (added by celloexpressions, 7 years ago)

Use h3 when the excerpt template is being used within a front page section.

  • src/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php

     
    3030                        </div><!-- .entry-meta -->
    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
    3642        <div class="entry-summary">