Make WordPress Core

Changeset 30237


Ignore:
Timestamp:
11/04/2014 09:18:22 PM (12 years ago)
Author:
iandstewart
Message:

Twenty Fifteen: use continue reading links for auto-generated excerpts to provide a readable link for screenreaders.

Props davidakennedy, kraftbj, fixes #30135.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/inc/template-tags.php

    r30232 r30237  
    221221}
    222222endif;
     223
     224if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) :
     225/**
     226 * Replaces "[...]" (appended to automatically generated excerpts) with ... and a Continue reading link.
     227 *
     228 * @since Twenty Fifteen 1.0
     229 *
     230 */
     231function twentyfifteen_excerpt_more( $more ) {
     232        $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
     233                esc_url( get_permalink( get_the_ID() ) ),
     234                /* translators: %s: Name of current post */
     235                sprintf( esc_html__( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
     236                );
     237        return ' &hellip; ' . $link;
     238}
     239add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' );
     240endif;
  • trunk/src/wp-content/themes/twentyfifteen/style.css

    r30229 r30237  
    181181.format-link .entry-title a:after,
    182182.entry-content .more-link:after,
     183.entry-summary .more-link:after,
    183184.author-link:after {
    184185        -moz-osx-font-smoothing: grayscale;
    … …  
    17571758}
    17581759
    1759 .entry-content .more-link {
     1760.entry-content .more-link,
     1761.entry-summary .more-link:after {
    17601762        white-space: nowrap;
    17611763}
    17621764
    1763 .entry-content .more-link:after {
     1765.entry-content .more-link:after,
     1766.entry-summary .more-link:after {
    17641767        content: "\f429";
    17651768        font-size: 16px;
    … …  
    32073210        }
    32083211
    3209         .entry-content .more-link:after {
     3212        .entry-content .more-link:after,
     3213        .entry-summary .more-link:after {
    32103214                font-size: 24px;
    32113215                top: 2px;
    … …  
    37423746        }
    37433747
    3744         .entry-content .more-link:after {
     3748        .entry-content .more-link:after,
     3749        .entry-summary .more-link:after {
    37453750                top: 3px;
    37463751        }
    … …  
    43784383        }
    43794384
    4380         .entry-content .more-link:after {
     4385        .entry-content .more-link:after,
     4386        .entry-summary .more-link:after {
    43814387                font-size: 16px;
    43824388                top: 5px;
    … …  
    49134919        }
    49144920
    4915         .entry-content .more-link:after {
     4921        .entry-content .more-link:after,
     4922        .entry-summary .more-link:after {
    49164923                font-size: 24px;
    49174924                top: 2px;
    … …  
    54255432        }
    54265433
    5427         .entry-content .more-link:after {
     5434        .entry-content .more-link:after,
     5435        .entry-summary .more-link:after {
    54285436                top: 3px;
    54295437        }
Note: See TracChangeset for help on using the changeset viewer.