Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter eArmin

    (@armin3000)

    length in setting is not working and output excerpt length doesn’t change even when I change the numbers.

    Thread Starter eArmin

    (@armin3000)

    I think my theme is using this function to generate excerpts. But I couldn’t find how to increase its length.

    if (get_option($shortname.'_use_excerpt') == 'on' && $postExcerpt <> '') {
    		if ($echo) echo $postExcerpt;
    		else return $postExcerpt;
    	} else {
    		$truncate = $post->post_content;
    
    		$truncate = preg_replace('@\[caption[^\]]*?\].*?\[\/caption]@si', '', $truncate);
    
    		if ( strlen($truncate) <= $amount ) $echo_out = ''; else $echo_out = '...';
    		$truncate = apply_filters('the_content', $truncate);
    		$truncate = preg_replace('@<script[^>]*?>.*?</script>@si', '', $truncate);
    		$truncate = preg_replace('@<style[^>]*?>.*?</style>@si', '', $truncate);
    
    		$truncate = strip_tags($truncate);
    
    		if ($echo_out == '...') $truncate = substr($truncate, 0, strrpos(substr($truncate, 0, $amount), ' '));
    		else $truncate = substr($truncate, 0, $amount);
    
    		if ($echo) echo $truncate,$echo_out;
    		else return ($truncate . $echo_out);
    	};

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP-UTF8-Excerpt] Number of characters in excerpt’ is closed to new replies.