WordPress.org

Ready to get started?Download WordPress

Forums

Duplicate Excerpts (1 post)

  1. Bryan Hadaway
    Member
    Posted 1 year ago #

    I'm using the following snippet in functions.php to get a "Read More" link on excerpts:

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

    Which works but is causing duplicate excerpts like so:

    Some Post Title
    Did you read the news today?...Did you read the news today? Read More

    Does anyone see anything obviously wrong with the code or perhaps can advise a better solution?

    Thanks, Bryan

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.