Heya,
For some reason the_excerpt() function doesn't always show the read more link for me. I can't figure out why... Can someone help? Thanks!
Heya,
For some reason the_excerpt() function doesn't always show the read more link for me. I can't figure out why... Can someone help? Thanks!
for instance, if the content of the post is shorter than the excerpt limit (default: 55 words) the 'read more' won't show.
if your case is different, a link to your site might help to illustrate your issue.
have you read:
http://codex.wordpress.org/Function_Reference/the_excerpt
Ah okay, that's what I thought. Yeah I've read the codex on this topic, maybe I'm just overlooking the answer then. But let me rephrase my question: "How can I ensure the read more link will always appear?"
Thanks!
you would need to hard code a 'read more' link (with the permalink to the post) into the template file; and remove the 'read more' from the excerpt.
Ah ha, okay that makes perfect sense. Thanks!
I have the same issue. I followed the instructions on this page:
http://codex.wordpress.org/Function_Reference/the_excerpt
In my functions.php file I have:
// Read More link
function new_excerpt_more($more) {
global $post;
return '... <a href="'. get_permalink($post->ID) . '">' . 'More >>' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
See the screenshot here:
http://www.kitacreative.com/hosting/no-excerpt.png
Notice how the MORE >> shows up on posts 6 and 3, but not 4 and 5. Also notice how that the excerpt text is longer for posts 4 and 5, so this is not a matter of having too little text.
Is there any other fix other than hard coding MORE >> into the template file?
are you using a hand-written excerpt in some of the posts?
(the_excerpt() will show the handwritten excerpt in full)
or are you using the 'more-tag' in the other posts?
(in which case your template is probably using the_content('more'); )
the image is not consistent with what the_excerpt() would do with ordinary posts (if all the posts are done in the same way: no more-tag and no handwritten)
for further info, you can also check my blog:
http://www.transformationpowertools.com/wordpress/read-more-on-all-excerpts-in-wordpress
http://www.transformationpowertools.com/wordpress/automatically-shorten-manual-excerpt
Ah, yes. Posts 4 and 5 had hand-written excerpts. And I was using the_excerpt() in my template file.
Thanks for the clarification!
This topic has been closed to new replies.