Help with changing read more code

Community Forums Forums General Discussion Help with changing read more code

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  sanjeev 1 year, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #66735

    alliechynna
    Participant
    Post count: 69

    I added this code to my site and on some to post it comes with 3 dots outside of the brackets. What do I need to change in the code to get rid of them?

    add_filter( ‘the_excerpt’, ‘sp_read_more_custom_excerpt’ );
    function sp_read_more_custom_excerpt( $text ) {
    if ( strpos( $text, ‘[…]’) ) {
    $excerpt = str_replace( ‘[…]’, ‘[Read More…]…‘, $text );
    } else {
    $excerpt = $text . ‘[Read More…]‘;
    }
    return $excerpt;
    }

    http://alliechynna.com
    #66769

    sanjeev
    Participant
    Post count: 34

    You can change the below line and see if it helps. (You have three dots after the read more text and I think this is what is creating issues…)

    $excerpt = str_replace( ‘[…]‘, ‘'<a class="more-link" href="' . get_permalink() . '">[Read More...]</a>', $text );


    Meet me at: Make Web World

    • This reply was modified 1 year, 1 month ago by  sanjeev.
    • This reply was modified 1 year, 1 month ago by  sanjeev.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.