Viewing 5 replies - 1 through 5 (of 5 total)
  • I have the exact same issue and found out that the code never checks for this case. Not sure if a fix is coming, so I added these few lines of code to advanced-excerpt.php.

    diff advanced-excerpt.mine.php advanced-excerpt.orig.php
    150,151d149
    < $orig_text = $text;
    <
    155,159d152
    < if (is_string($orig_text) && is_string($text) &&
    < (strlen(trim($orig_text)) == strlen($text))) {
    < return $orig_text;
    < }
    <

    Officeninjas, where in advanced-excerpt.php do i have to place the code? I am new to php.

    thanks!

    same, i’m ok with putting code in my files, but the formatting on the code you’ve provided is confusing. the “<” dont look like normal php. is the forum reformatting your fix? id really really like to incorporate this if you can clarify that would be great!

    the “<” are from the “diff” command showing that those lines are in his version of the file but not in the original. Basically he added at line 150:

    $orig_text = $text;

    which saves the original text

    and then starting at line 155 he inserted:

    if (is_string($orig_text) && is_string($text) &&
    (strlen(trim($orig_text)) == strlen($text))) {
    return $orig_text;
    }

    So if the original text and the modified text are the same length, just return. Otherwise it continues on to the next line which is the one that adds the “Read More” link.

    This bug is still present in version 4.1.1 of the plugin. I have updated the diff/patch – see https://pastebin.ca/2459294

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘read more button always there’ is closed to new replies.