【发布时间】:2013-06-13 13:48:51
【问题描述】:
在这里,我创建了一个函数来限制特定帖子类型的摘录长度(因为我只在渐变滑块中显示该特定帖子类型的摘录),使用以下函数:
function client_excerpt($length) {
global $post;
if ($post->post_type == 'testimonial')
return 20;
else
return 55;
}
add_filter('excerpt_length', 'client_excerpt');
现在,当我在循环中调用 get_the_excerpt 为滑块输出我的 div 时,它工作得很好。但是,我不希望“阅读更多...”链接仅出现在这些摘录中。我可以阻止它们显示在我的函数中的那些特定摘录中吗?
【问题讨论】:
-
如果您在谈论 wordpress,那么值得一提的是问题中的事实