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

Props davidakennedy, kraftbj, fixes #30135.


Built from https://develop.svn.wordpress.org/trunk@30237


git-svn-id: http://core.svn.wordpress.org/trunk@30237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ian Stewart 2014-11-04 21:19:22 +00:00
parent 2047ff9e5a
commit 1483e80848
3 changed files with 35 additions and 9 deletions

View File

@ -219,4 +219,22 @@ function twentyfifteen_get_link_url() {
return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() );
}
endif;
endif;
if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) :
/**
* Replaces "[...]" (appended to automatically generated excerpts) with ... and a Continue reading link.
*
* @since Twenty Fifteen 1.0
*
*/
function twentyfifteen_excerpt_more( $more ) {
$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( esc_html__( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
);
return ' &hellip; ' . $link;
}
add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' );
endif;

View File

@ -180,6 +180,7 @@ a img {
.image-navigation a:after,
.format-link .entry-title a:after,
.entry-content .more-link:after,
.entry-summary .more-link:after,
.author-link:after {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
@ -1756,11 +1757,13 @@ a.post-thumbnail:focus {
border-bottom: 0;
}
.entry-content .more-link {
.entry-content .more-link,
.entry-summary .more-link:after {
white-space: nowrap;
}
.entry-content .more-link:after {
.entry-content .more-link:after,
.entry-summary .more-link:after {
content: "\f429";
font-size: 16px;
position: relative;
@ -3206,7 +3209,8 @@ span > video {
margin-bottom: 1.6471em;
}
.entry-content .more-link:after {
.entry-content .more-link:after,
.entry-summary .more-link:after {
font-size: 24px;
top: 2px;
}
@ -3741,7 +3745,8 @@ span > video {
margin-bottom: 1.6842em;
}
.entry-content .more-link:after {
.entry-content .more-link:after,
.entry-summary .more-link:after {
top: 3px;
}
@ -4377,7 +4382,8 @@ span > video {
margin-bottom: 1.6em;
}
.entry-content .more-link:after {
.entry-content .more-link:after,
.entry-summary .more-link:after {
font-size: 16px;
top: 5px;
}
@ -4912,7 +4918,8 @@ span > video {
margin-bottom: 1.6471em;
}
.entry-content .more-link:after {
.entry-content .more-link:after,
.entry-summary .more-link:after {
font-size: 24px;
top: 2px;
}
@ -5424,7 +5431,8 @@ span > video {
margin-bottom: 1.6842em;
}
.entry-content .more-link:after {
.entry-content .more-link:after,
.entry-summary .more-link:after {
top: 3px;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-alpha-30236';
$wp_version = '4.1-alpha-30237';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.