前段时间换了主题,再到WPtouch界面后,点击文章标题后的下拉菜单居然不自动截取摘要了…… 估计是主题的问题吧……
添加以下代码段到functions.php或者wptouch.php中保存即可
add_filter('the_content','substr_content'); function substr_content($content){ if(!is_singular()){ $content=mb_strimwidth(strip_tags($content),0,200); } return $content; }content后的200可以更改哦!建议50-300之间
好了,打开你的博客看看吧!
转载请注明:神奇海域 » 【WordPress】添加摘要