Forums

[resolved] Excerpt function doesn't always show the read more link... (8 posts)

  1. Spencer Hill
    Member
    Posted 1 year ago #

    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!

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    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

  3. Spencer Hill
    Member
    Posted 1 year ago #

    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!

  4. alchymyth
    The Sweeper
    Posted 1 year ago #

    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.

  5. Spencer Hill
    Member
    Posted 1 year ago #

    Ah ha, okay that makes perfect sense. Thanks!

  6. Jenn
    Member
    Posted 1 year ago #

    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?

  7. alchymyth
    The Sweeper
    Posted 1 year ago #

    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

  8. Jenn
    Member
    Posted 1 year ago #

    Ah, yes. Posts 4 and 5 had hand-written excerpts. And I was using the_excerpt() in my template file.

    Thanks for the clarification!

Topic Closed

This topic has been closed to new replies.

About this Topic