Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

On my blog on all my main loops I have it set to show the excerpt instead of the content

If I make a longer post and leave the excerpt text box empty, then wordpress will make it's own excerpt from my post and show the [...] or a custom link at the end. Thats great however if I DO enter my own excerpt into the excerpt textbox, it will show that text but it will not show the read more part added to it.

Does anyone know how I can make it always show a read more?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Perhaps a conditional statement like the following will work. The logic is: "If the post has an explicit excerpt, add a read more link. Otherwise, use default excerpt behavior."

if($post->post_excerpt) {
the_excerpt();
echo '<a href="'.the_permalink().'">Read More</a>';
} else {
the_excerpt();
}

You can use this in combination with Gavin's suggestion to unify the appearance of the "Read More" link.

share|improve this answer
    
Hello, thanks that is pretty much what I was looking for (untested but looks good) thank you –  jasondavis Jan 5 '12 at 20:15
add comment

Add this in your theme's functions.php:

function new_excerpt_more($more) {
       global $post;
    return '<a href="'. get_permalink($post->ID) . '">Read the Rest...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');

More info: Make the "read more" link to the post

Good luck!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.