From 1483e808484ab36593cc58f48832b6159523f9cc Mon Sep 17 00:00:00 2001 From: Ian Stewart Date: Tue, 4 Nov 2014 21:19:22 +0000 Subject: [PATCH] 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 --- .../twentyfifteen/inc/template-tags.php | 20 ++++++++++++++++- wp-content/themes/twentyfifteen/style.css | 22 +++++++++++++------ wp-includes/version.php | 2 +- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/wp-content/themes/twentyfifteen/inc/template-tags.php b/wp-content/themes/twentyfifteen/inc/template-tags.php index 2a8844ee14..b06bc71b1e 100644 --- a/wp-content/themes/twentyfifteen/inc/template-tags.php +++ b/wp-content/themes/twentyfifteen/inc/template-tags.php @@ -219,4 +219,22 @@ function twentyfifteen_get_link_url() { return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } -endif; \ No newline at end of file +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( '%2$s', + esc_url( get_permalink( get_the_ID() ) ), + /* translators: %s: Name of current post */ + sprintf( esc_html__( 'Continue reading %s', 'twentyfifteen' ), '' . get_the_title( get_the_ID() ) . '' ) + ); + return ' … ' . $link; +} +add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' ); +endif; diff --git a/wp-content/themes/twentyfifteen/style.css b/wp-content/themes/twentyfifteen/style.css index 9810964e85..09da6209b9 100644 --- a/wp-content/themes/twentyfifteen/style.css +++ b/wp-content/themes/twentyfifteen/style.css @@ -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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index d747f17346..e6314f906b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.