If you want to add a ‘read more’ link to your manual excerpts, here’s how to do it.
//* Changing excerpt more - only works where excerpt IS hand-crafted function manual_excerpt_more( $excerpt ) { $excerpt_more = ''; if( has_excerpt() ) { $excerpt_more = ' <a href="' . get_permalink() . '" rel="nofollow">[Read more]</a>'; } return $excerpt . $excerpt_more; } add_filter( 'get_the_excerpt', 'manual_excerpt_more' );
I tested this code with a child theme from Genesis but it should work for all themes.
If you enjoyed this post, make sure to subscribe to WP Mayor’s RSS feed.
6 Responses
Thanks for your kind post, it saved my whole day!
Thanks
Hi! Thank you very much!
May be you know how to make that my custom more link showing in same paragraph. Now it looks like that:
(paragraph tag open)
here manual excerpt text
(paragraph tag close)
(paragraph tag open)
here my custom more link
(paragraph tag close)
I want to display more link inline at the end of excerpt text, after last letter.
Thank you so much for this!
The manually created excerpts don’t have anything like “read more” in the RSS feed. The posts have the link on the main page. When I look in the RSS feed, I can see that the automatically generated excerpts have […] at the end. Do you know how to add something to those manually created excerpts in the RSS feed?
Thanks dude, very helpful.