Function for title not working properly
-
Hi, everyone,
I have this function set in functions.phpfunction titluscurt($text) { $chars_limit = 80; $chars_text = strlen($text); $text = $text." "; $text = substr($text,0,$chars_limit); $text = substr($text,0,strrpos($text,' ')); if ($chars_text > $chars_limit) { $text = $text. "..."; } return $text; }
It’s function that shortens the title and ads
...
at the end of shortened title.
It worked perfectly fine until update to WordPress 6.0. Now it shortens the titles but not adding the...
at the end, with one exception, if I have in the title a comma (,). Does anyone have any ideea why and how to fix this? Thank you.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Function for title not working properly’ is closed to new replies.