Home › Forums › Iconic One Pro Support › UTF8 Excerpt Problem
- This topic has 1 reply, 2 voices, and was last updated 9 years ago by
Themonic-Support.
Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
- April 8, 2017 at 1:01 am #4850
yiranguo
ParticipantThe Excerpt doesn’t work well because my language of content is Chinese. May I know how to solve this problem, please?
My website: https://guoyiran.cn/
April 8, 2017 at 10:10 am #4851Themonic-Support
KeymasterOne of the easy solution is to install this plugin
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' ) . ' »</a></span>'; } return $output; } add_filter( 'get_the_excerpt', 'iconic_one_pro_chinese_excerpt' );sending the same to your email.
- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
