Excerpt Length & List Category Posts Plugin
I'm trying to filter out the excerpt by character length for a plugin called "List Category Posts". I've been trying to get the excerpts working for the past week, but nothing is doing the trick. The plugin actually comes with a feature that allows you to post the excerpt or not, then filter it by character length.. by adding "excerpt_size=" in the shortcode. But unfortunately, it doesn't work at this time, and I've tested it with multiple different themes. Anyways, here is the code it uses to get the excerpt:
public function get_excerpt($single){
if (
$this-params['excerpt']=='yes'
!($this-params['content']=='yes'
$single-post_content) ){
/*
* Strip shortcodes - #5
* http://codex.wordpress.org/Function_Reference/strip_shortcodes
*/
if($single-post_excerpt){
return $single-post_excerpt;
}
$lcp_excerpt = strip_shortcodes(strip_tags($single-post_content));
$exc_lim = intval($this-params['excerpt_size']);
$lcp_excerpt = mb_substr($lcp_excerpt, 0, $exc_lim) . '...';
return $lcp_excerpt;
} else {
return null;
}
}
and the excerts are set by default like so (I've tried changing the 'excerpt_size' default parameter below, and it did not work):
'excerpt' = 'no',
'excerpt_size' = '255',
I don't even need a grand solution to get the whole shortcode excerpt filter to work with any number I enter. If anyone could help me get it to work so all the excerpt character lengths are say, 100. That would be amazing!
Topic plugin-list-category-post shortcode excerpt Wordpress
Category Web