The Night Fox
Member
Posted 1 year ago #
Hi, could anyone tell me how to remove the read more link from my post excerpts?
//EXCERPT
function excerpt_length( $length ) {
return 10;
}
add_filter( 'excerpt_length', 'excerpt_length' );
function continue_reading_link() {
return ' <a href="'. get_permalink() . '">' . __( 'Read more <span class="meta-nav">→</span>', 'twentyten' ) . '</a>';
}
function auto_excerpt_more( $more ) {
return ' …' . continue_reading_link();
}
add_filter( 'excerpt_more', 'auto_excerpt_more' );
function custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'custom_excerpt_more' );
//EXCERPT
Thanks.
It says 'Read more' right there in your code. Just replace it by a space.
If you want to remove the link entirely, replace this:
function continue_reading_link() {
return ' <a href="'. get_permalink() . '">' . __( 'Read more <span class="meta-nav">→</span>', 'twentyten' ) . '</a>';
}
With this:
function continue_reading_link() {
return '';
}
The Night Fox
Member
Posted 1 year ago #
Thanks for the help, that worked perfectly!
roxette cassette
Member
Posted 9 months ago #
Hi,
Im trying to do the exact same thing....
Which file do I need to edit this in? I've had a look but can't see it in functions or post-template php, or have I just missed it?
Thanks so much in advance,
roxette cassette
Member
Posted 9 months ago #
hello,
can anyone help me with this please and point me in the right direction?
thankyou...