我正在索引页上显示wordpress帖子,其中包含:
<?php the_excerpt(); ?>
在我的功能中。php文件我有以下代码:add_filter(\'excerpt_length\', \'my_excerpt_length\');
function my_excerpt_length($length) {
return 30; }
这很好,但它显示[...]
在摘录的末尾。我想删除这些[
和]
相反,我只想显示三个点...
. 我该怎么做?谢谢我正在索引页上显示wordpress帖子,其中包含:
<?php the_excerpt(); ?>
在我的功能中。php文件我有以下代码:add_filter(\'excerpt_length\', \'my_excerpt_length\');
function my_excerpt_length($length) {
return 30; }
这很好,但它显示[...]
在摘录的末尾。我想删除这些[
和]
相反,我只想显示三个点...
. 我该怎么做?谢谢使用excerpt_more
过滤器挂钩:
function mytheme_excerpt_more( $text ) {
$text = \'...\';
return $text;
}
add_filter( \'excerpt_more\', \'mytheme_excerpt_more\' );
我有一个模板,可以拉动三个帖子query\\u posts()循环。其中两篇帖子被截断为10个单词,就像我在过滤器中设置的一样。第三个决定忽略过滤器,吐出33个单词。我看不出这些帖子之间有什么区别。有人知道为什么会这样吗?while (have_posts()) : the_post(); $img = get_post_meta($post->ID, \'Featured Thumbnail\', true); ?> &