Support » Plugin: Advanced Excerpt » 'Read More' link appears inside excerpt – solved (sort of)

  • [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser]

    I’m just an ambitious amateur, but here’s my fix for the problem that makes the “read more” link appear in the middle of the excerpt – instead of at the end where it should be – when you leave certain html formatting in the post excerpt – like <b> or <strong>.

    There is some if/then code in ‘advanced-excerpt.php’ that looks like it does this behavior on purpose – although I can’t figure out why. So I just overwrote the condition that causes the problem – with the line that does it correctly.

    Here’s how I did it …

    Open the advanced-excerpt.php file in the wp-content/plugins/advanced-excerpt folder.

    Go to line 214 and replace this code…
    $text = substr_replace($text, $ellipsis, $pos, 0);

    …with this code
    $text .= $ellipsis;

    save and re-upload the file (if you make the change locally).

    That’s it – now the plugin shows the ‘read more’ link at the end of the excerpt – even when I retain the text formatting.

    Not sure what else I might have affected by doing this – but it seems to work perfectly now.


    Jack Coletti
    [sig moderated as per the Forum Rules]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘'Read More' link appears inside excerpt – solved (sort of)’ is closed to new replies.