Twenty Fifteen: use continue reading links for auto-generated excerpts to provide a readable link for screenreaders.
Props davidakennedy, kraftbj, fixes #30135. git-svn-id: https://develop.svn.wordpress.org/trunk@30237 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
15485e1945
commit
367b8e340e
|
@ -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 ' … ' . $link;
|
||||
}
|
||||
add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' );
|
||||
endif;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue