diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index 6a4a0dcbe..5cde25435 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -249,7 +249,17 @@ function twentyten_excerpt_length( $length ) { add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); /** - * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis. + * Returns a "Continue Reading" link for excerpts + * + * @since Twenty Ten 1.0 + * @return string "Continue Reading" link + */ +function twentyten_continue_reading_link() { + return ' ' . __( 'Continue reading ', 'twentyten' ) . ''; +} + +/** + * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. @@ -258,12 +268,12 @@ add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); * @return string An ellipsis */ function twentyten_auto_excerpt_more( $more ) { - return ' …'; + return ' …' . twentyten_continue_reading_link(); } add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' ); /** - * Adds a pretty "Continue Reading" link to post excerpts. + * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. @@ -272,7 +282,10 @@ add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' ); * @return string Excerpt with a pretty "Continue Reading" link */ function twentyten_custom_excerpt_more( $output ) { - return $output . ' ' . __( 'Continue reading ', 'twentyten' ) . ''; + if ( has_excerpt() ) { + $output .= twentyten_continue_reading_link(); + } + return $output; } add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );