Advanced Excerpt
'Read More' link appears inside excerpt - solved (sort of) (2 posts)

  1. signwavejack
    Posted 2 years ago #

    [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]


  2. photocurio
    Posted 2 years ago #

    Thanks, Jack! This is appreciated. I which the plugin author would incorporate this update.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Excerpt
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic