HI Guys
see the first article excerpt on this page
http://stevewatsondemos.com/india/
Can someone show me a function to
1. not show this
2. to change it to Read More
so i have a choice please.
Arnav Joy answers:
Hi Steve ,
Check these links
http://codex.wordpress.org/Function_Reference/the_excerpt
http://kb.oboxsites.com/knowledgebase/how-to-change-or-remove-the-dots-at-the-end-of-excerpts/
Steve Watson comments:
Thanks Arnav :)
Hariprasad Vijayan answers:
Hello,
Which one you don't want to show?
Steve Watson comments:
Thanks Hariprasad I found this
// Changing excerpt more
function new_excerpt_more($more) {
global $post;
return '… <a href="'. get_permalink($post->ID) . '">' . 'Read more' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
and i have just removed the Read more bit
// Changing excerpt more
function new_excerpt_more($more) {
global $post;
return '… <a href="'. get_permalink($post->ID) . '">' . '' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
If you know a more efficient way let me know.
thanks
Hariprasad Vijayan comments:
May be you are searching for
function trim_excerpt($text) {
return rtrim($text,'...');
}
add_filter('get_the_excerpt', 'trim_excerpt');
Steve Watson comments:
I think that is broken
Steve Watson comments:
I think that is broken
Ryan S answers:
To remove the '[...]' or '...' and replace with a Read More text, try this
function rs_new_excerpt_more( $more ) {
global $post;
return '<a href="'. esc_url( get_permalink($post->ID) ) . '" class="blog-continue-reading">Read more →</a>';
}
add_filter( 'excerpt_more', 'rs_new_excerpt_more' );
Of course to remove '[...]' or '...' completely, use this instead
function rs_new_excerpt_more( $more ) {
return '';
}
add_filter( 'excerpt_more', 'rs_new_excerpt_more' );
Hope that helps
Just Me answers:
If you remove the "read more" part, all you return is a non clickable link, why return anything at all?