From f398bd07cee0b167849c9eb52ab993b6a67a3219 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Wed, 19 Nov 2014 18:27:22 +0000 Subject: [PATCH] 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 --- .../themes/twentyfourteen/content-aside.php | 7 +++++- .../themes/twentyfourteen/content-audio.php | 7 +++++- .../themes/twentyfourteen/content-gallery.php | 7 +++++- .../themes/twentyfourteen/content-image.php | 7 +++++- .../themes/twentyfourteen/content-link.php | 7 +++++- .../themes/twentyfourteen/content-quote.php | 7 +++++- .../themes/twentyfourteen/content-video.php | 7 +++++- wp-content/themes/twentyfourteen/content.php | 7 +++++- .../twentyfourteen/inc/template-tags.php | 23 ++++++++++++++++++- 9 files changed, 70 insertions(+), 9 deletions(-) diff --git a/wp-content/themes/twentyfourteen/content-aside.php b/wp-content/themes/twentyfourteen/content-aside.php index 3837a2e9ec..5dcaeeb068 100644 --- a/wp-content/themes/twentyfourteen/content-aside.php +++ b/wp-content/themes/twentyfourteen/content-aside.php @@ -43,7 +43,12 @@
→', 'twentyfourteen' ) ); + /* translators: %s: Name of current post */ + the_content( sprintf( + esc_html__( 'Continue reading %s', 'twentyfourteen' ), + the_title( '', ' ', false ) + ) ); + wp_link_pages( array( 'before' => '', diff --git a/wp-content/themes/twentyfourteen/content-audio.php b/wp-content/themes/twentyfourteen/content-audio.php index cb5b022482..12a35c72e9 100644 --- a/wp-content/themes/twentyfourteen/content-audio.php +++ b/wp-content/themes/twentyfourteen/content-audio.php @@ -43,7 +43,12 @@
→', 'twentyfourteen' ) ); + /* translators: %s: Name of current post */ + the_content( sprintf( + esc_html__( 'Continue reading %s', 'twentyfourteen' ), + the_title( '', ' ', false ) + ) ); + wp_link_pages( array( 'before' => '', diff --git a/wp-content/themes/twentyfourteen/content-gallery.php b/wp-content/themes/twentyfourteen/content-gallery.php index c49a26143d..15c119921f 100644 --- a/wp-content/themes/twentyfourteen/content-gallery.php +++ b/wp-content/themes/twentyfourteen/content-gallery.php @@ -43,7 +43,12 @@
→', 'twentyfourteen' ) ); + /* translators: %s: Name of current post */ + the_content( sprintf( + esc_html__( 'Continue reading %s', 'twentyfourteen' ), + the_title( '', ' ', false ) + ) ); + wp_link_pages( array( 'before' => '', diff --git a/wp-content/themes/twentyfourteen/content-image.php b/wp-content/themes/twentyfourteen/content-image.php index 836601ff40..2ea52ecfc6 100644 --- a/wp-content/themes/twentyfourteen/content-image.php +++ b/wp-content/themes/twentyfourteen/content-image.php @@ -43,7 +43,12 @@
→', 'twentyfourteen' ) ); + /* translators: %s: Name of current post */ + the_content( sprintf( + esc_html__( 'Continue reading %s', 'twentyfourteen' ), + the_title( '', ' ', false ) + ) ); + wp_link_pages( array( 'before' => '', diff --git a/wp-content/themes/twentyfourteen/content-link.php b/wp-content/themes/twentyfourteen/content-link.php index d208ba09a0..8700f2b07e 100644 --- a/wp-content/themes/twentyfourteen/content-link.php +++ b/wp-content/themes/twentyfourteen/content-link.php @@ -43,7 +43,12 @@
→', 'twentyfourteen' ) ); + /* translators: %s: Name of current post */ + the_content( sprintf( + esc_html__( 'Continue reading %s', 'twentyfourteen' ), + the_title( '', ' ', false ) + ) ); + wp_link_pages( array( 'before' => '', diff --git a/wp-content/themes/twentyfourteen/content-quote.php b/wp-content/themes/twentyfourteen/content-quote.php index b93cf994ad..6699695b08 100644 --- a/wp-content/themes/twentyfourteen/content-quote.php +++ b/wp-content/themes/twentyfourteen/content-quote.php @@ -43,7 +43,12 @@
→', 'twentyfourteen' ) ); + /* translators: %s: Name of current post */ + the_content( sprintf( + esc_html__( 'Continue reading %s', 'twentyfourteen' ), + the_title( '', ' ', false ) + ) ); + wp_link_pages( array( 'before' => '', diff --git a/wp-content/themes/twentyfourteen/content-video.php b/wp-content/themes/twentyfourteen/content-video.php index bedbd7fbd2..b10b69b665 100644 --- a/wp-content/themes/twentyfourteen/content-video.php +++ b/wp-content/themes/twentyfourteen/content-video.php @@ -43,7 +43,12 @@
→', 'twentyfourteen' ) ); + /* translators: %s: Name of current post */ + the_content( sprintf( + esc_html__( 'Continue reading %s', 'twentyfourteen' ), + the_title( '', ' ', false ) + ) ); + wp_link_pages( array( 'before' => '', diff --git a/wp-content/themes/twentyfourteen/content.php b/wp-content/themes/twentyfourteen/content.php index d9bf754f1e..8a3842144e 100644 --- a/wp-content/themes/twentyfourteen/content.php +++ b/wp-content/themes/twentyfourteen/content.php @@ -51,7 +51,12 @@
→', 'twentyfourteen' ) ); + /* translators: %s: Name of current post */ + the_content( sprintf( + esc_html__( 'Continue reading %s', 'twentyfourteen' ), + the_title( '', ' ', false ) + ) ); + wp_link_pages( array( 'before' => '', diff --git a/wp-content/themes/twentyfourteen/inc/template-tags.php b/wp-content/themes/twentyfourteen/inc/template-tags.php index 6b22444086..8f171f19ec 100644 --- a/wp-content/themes/twentyfourteen/inc/template-tags.php +++ b/wp-content/themes/twentyfourteen/inc/template-tags.php @@ -194,10 +194,31 @@ function twentyfourteen_post_thumbnail() { if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { the_post_thumbnail( 'twentyfourteen-full-width' ); } else { - the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); + the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); } ?> %2$s', + esc_url( get_permalink( get_the_ID() ) ), + /* translators: %s: Name of current post */ + sprintf( esc_html__( 'Continue reading %s', 'twentyfourteen' ), '' . get_the_title( get_the_ID() ) . ' ' ) + ); + return ' … ' . $link; +} +add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' ); +endif;