Reply To: UTF8 Excerpt Problem

Home Forums Iconic One Pro Support UTF8 Excerpt Problem Reply To: UTF8 Excerpt Problem

#4851

One of the easy solution is to install this plugin

WP-UTF8-Excerpt

Just make sure that images in the article are after first paragraph else it will show both images along with excerpt.

— Perfect solution —

Check out these lines 68-71 of functions.php


function themonic_excerpt_length( $length ) {
	return 58;
}
add_filter( 'excerpt_length', 'themonic_excerpt_length', 999 );

and replace the above lines with


function iconic_one_pro_chinese_excerpt( $output ) {
global $post;
$chinese_output = preg_match_all("/\p{Han}+/u", $post->post_content, $matches);
if($chinese_output) {
$output = mb_substr( $output, 0, 180 ) . '… <span class="read-more"><a href="'. get_permalink($post->ID) . '">' . __( 'Read More', 'themonic' ) . ' &raquo;</a></span>';
}
return $output;
}
add_filter( 'get_the_excerpt', 'iconic_one_pro_chinese_excerpt' );

sending the same to your email.