Twenty Fourteen: replace ellipses appended to automatically generated excerpts with both ellipses and a "Continue Reading" link to meet accessibility-ready requirements.
Props davidakennedy, lancewillett. Fixes #30176. Built from https://develop.svn.wordpress.org/trunk@30389 git-svn-id: http://core.svn.wordpress.org/trunk@30386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5c6de0c973
commit
f398bd07ce
|
@ -43,7 +43,12 @@
|
|||
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
/* translators: %s: Name of current post */
|
||||
the_content( sprintf(
|
||||
esc_html__( 'Continue reading %s', 'twentyfourteen' ),
|
||||
the_title( '<span class="screen-reader-text">', '</span> <span class="meta-nav">→</span>', false )
|
||||
) );
|
||||
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
/* translators: %s: Name of current post */
|
||||
the_content( sprintf(
|
||||
esc_html__( 'Continue reading %s', 'twentyfourteen' ),
|
||||
the_title( '<span class="screen-reader-text">', '</span> <span class="meta-nav">→</span>', false )
|
||||
) );
|
||||
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
/* translators: %s: Name of current post */
|
||||
the_content( sprintf(
|
||||
esc_html__( 'Continue reading %s', 'twentyfourteen' ),
|
||||
the_title( '<span class="screen-reader-text">', '</span> <span class="meta-nav">→</span>', false )
|
||||
) );
|
||||
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
/* translators: %s: Name of current post */
|
||||
the_content( sprintf(
|
||||
esc_html__( 'Continue reading %s', 'twentyfourteen' ),
|
||||
the_title( '<span class="screen-reader-text">', '</span> <span class="meta-nav">→</span>', false )
|
||||
) );
|
||||
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
/* translators: %s: Name of current post */
|
||||
the_content( sprintf(
|
||||
esc_html__( 'Continue reading %s', 'twentyfourteen' ),
|
||||
the_title( '<span class="screen-reader-text">', '</span> <span class="meta-nav">→</span>', false )
|
||||
) );
|
||||
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
/* translators: %s: Name of current post */
|
||||
the_content( sprintf(
|
||||
esc_html__( 'Continue reading %s', 'twentyfourteen' ),
|
||||
the_title( '<span class="screen-reader-text">', '</span> <span class="meta-nav">→</span>', false )
|
||||
) );
|
||||
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
/* translators: %s: Name of current post */
|
||||
the_content( sprintf(
|
||||
esc_html__( 'Continue reading %s', 'twentyfourteen' ),
|
||||
the_title( '<span class="screen-reader-text">', '</span> <span class="meta-nav">→</span>', false )
|
||||
) );
|
||||
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
|
|
|
@ -51,7 +51,12 @@
|
|||
<?php else : ?>
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
/* translators: %s: Name of current post */
|
||||
the_content( sprintf(
|
||||
esc_html__( 'Continue reading %s', 'twentyfourteen' ),
|
||||
the_title( '<span class="screen-reader-text">', '</span> <span class="meta-nav">→</span>', false )
|
||||
) );
|
||||
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
|
|
|
@ -201,3 +201,24 @@ function twentyfourteen_post_thumbnail() {
|
|||
|
||||
<?php endif; // End is_singular()
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'twentyfourteen_excerpt_more' ) && ! is_admin() ) :
|
||||
/**
|
||||
* Replaces "[...]" (appended to automatically generated excerpts) with ...
|
||||
* and a Continue reading link.
|
||||
*
|
||||
* @since Twenty Fourteen 1.3
|
||||
*
|
||||
* @param string $more Default Read More excerpt link.
|
||||
* @return string Filtered Read More excerpt link.
|
||||
*/
|
||||
function twentyfourteen_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', 'twentyfourteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span> <span class="meta-nav">→</span>' )
|
||||
);
|
||||
return ' … ' . $link;
|
||||
}
|
||||
add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' );
|
||||
endif;
|
||||
|
|
Loading…
Reference in New Issue