I want this because:
1-) I have a list item ol /ol at the start of my every post.
2-) When wordpress shows summary of the post it reads some words from the beginning of the post.
3-) This causes the summary to be comprised of the navigation list of the post. The words from inside the ol /ol tags.
4-) I don’t want the words from ol tags in my excerpt. I want it to directly go beyond the /ol tags for the excerpt content.
My code is:
function custom_excerpt($text) {
$pos = strpos($text, '</ol>');
$text = substr($text, $pos);
return $text;
}
add_filter('the_excerpt', 'custom_excerpt');
This doesn’t work. I guess the tags are already stripped so “strpos” can’t find anything. But even i return “…” from function, the same text as before stays. Like my custom function has no effect. Why is that? Is the theme’s functions somehow interferes with the excerpt code?