wordpress the_excerpt函数中文长度问题(无插件)
http://wiinder.com/wordpress-new-excerpt.html
结合以上两篇博文 哥得出的中文摘要 无插件解决办法
functions函数中添加
function new_excerpt_length($length) {
return 75;
}
add_filter('excerpt_length', 'new_excerpt_length');
function new_excerpt_more($more) {
return '';
}
add_filter('excerpt_more', 'new_excerpt_more');
function excerpt_read_more_link($output) {
global $post;
//$output = strip_tags($output);
$output = mb_substr($output,0, 200); //此处的200大于75是没有用的 最多75 具体机制俺没细看
return $output;
}
add_filter('the_excerpt', 'excerpt_read_more_link');
成功解决问题