Had the same problem, even a very short excerpt had the “continue reading” link added in slider.
Turned out it was a problem of the parent theme, in this case Twenty Ten, it adds the link in Twenty Ten functions.php
via a filter twentyten_custom_excerpt_more
added to get_the_excerpt()
around line 280.
To disable this magic, add something like this to child theme functions.php
:
function my_child_theme_setup() {
remove_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
}
add_action( 'after_setup_theme', 'my_child_theme_setup' );
Removing the filter of course also disables adding the link at other places where get_the_excerpt()
is used, so we add it again, but not with the ‘slides’ custom post type:
function my_adjusted_twentyten_custom_excerpt_more( $output ) {
if ( get_post_type() !== 'slides' && has_excerpt() && ! is_attachment() ) {
$output .= twentyten_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'my_adjusted_twentyten_custom_excerpt_more' );
Note: With a Twenty Eleven based theme there is a similar filter to be dealt with: twentyeleven_custom_excerpt_more