Support » Plugin: Recent Posts Widget Extended » Getting 2 "read more" links showing up

  • I added this plugin and when using it I got the post excerpt being rendered like this:

    First part of the post blah blah … Read more Read more >>

    There were 2 Read more links at the end, but only the final one “Read more >>” had the link on it. When I disabled the option on your plugin to not display the Read More link, the last “Read More >>” disappeared, but the first one without the link remained.

    Looking more into it, I think the problem is the use of the wp_trim_words function which apparently strips all tags from the trimmed text, hence losing the “a” tag.

    I have currently worked around the problem by doing the following – replaced the following line in recent-posts-widget-extended/includes/functions.php:

    Original:
    $html .= wp_trim_words( apply_filters( 'rpwe_excerpt', get_the_excerpt() ), $args['length'], ' …' );

    Replaced with:
    $html .= get_the_excerpt(); // Modified from original

    The downside of this is that the excerpt length setting on your plugin basically has no effect any more, but the default length of 55 suits me just fine for now.

    Ideally I don’t want to make any changes to your plugin code, so if you’re able to fix the bug in the next version, that would be fantastic. I would suggest – don’t use wp_trim_words and do it all in your own code.

    https://wordpress.org/plugins/recent-posts-widget-extended/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Getting 2 "read more" links showing up’ is closed to new replies.