我已将以下代码添加到我的主题中的 functions.php 脚本中:
function custom_excerpt_length( $length ) {
return 15;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function new_excerpt_more( $more ) {
return '...';
}
add_filter('excerpt_more', 'new_excerpt_more');
如本页所建议: http: //codex.wordpress.org/Template_Tags/the_excerpt
但摘录的长度仍然是默认的 55 个单词,并且末尾的字符串仍然是[...]
而不是...
.
WordPress 版本是 3.4.1
我用来显示摘录的代码很简单:
the_excerpt();
有没有人对如何修复它有任何想法,以便我的 functions.php 的添加工作?