Excerpt length does not seems to be respected

Created on 6 February 2015, over 10 years ago
Updated 13 May 2025, about 7 hours ago

I was trying to get a more usefull excerpt (longer), and from what I understand in the code that generates if, it doesn't seems to respect the options you have specified in the backend.

        // Now locate a space in front (position $q) and behind it (position $s),
        // leaving about 60 characters extra before and after for context.
        // Note that a space was added to the front and end of $text above.
        if ($p) {
          if (($q = strpos(' ' . $text, ' ', max(0, $p - 61))) !== FALSE) {
            $end = substr($text . ' ', $p, 80);
            if (($s = strrpos($end, ' ')) !== FALSE) {

-61 and 80 are hardcoded here.
Maybe we should use our custom "excerpt_lenght" (divided by 2) here ?

🐛 Bug report
Status

Needs work

Version

1.0

Component

Plugins

Created by

🇫🇷France Haza

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024