Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress:删除;阅读更多“;来自自定义摘录函数的链接?_Php_Wordpress_Function - Fatal编程技术网

Php Wordpress:删除;阅读更多“;来自自定义摘录函数的链接?

Php Wordpress:删除;阅读更多“;来自自定义摘录函数的链接?,php,wordpress,function,Php,Wordpress,Function,这里简单介绍一下,我创建了一个函数,使用以下函数仅限制特定文章类型的摘录长度(因为我仅在淡入滑块中显示该特定文章类型的摘录): function client_excerpt($length) { global $post; if ($post->post_type == 'testimonial') return 20; else return 55; } add_filter('excerpt_length', 'client_exc

这里简单介绍一下,我创建了一个函数,使用以下函数仅限制特定文章类型的摘录长度(因为我仅在淡入滑块中显示该特定文章类型的摘录):

function client_excerpt($length) {
global $post;
    if ($post->post_type == 'testimonial')
         return 20;
    else
         return 55;
}
add_filter('excerpt_length', 'client_excerpt');
现在,当我调用get_为滑块输出div的循环中的_摘录时,这就很好了。然而,我不希望“阅读更多…”链接只出现在这些摘录上。我可以停止在我的功能中的特定摘录中显示它们吗?

使用以下命令尝试此操作:


如果你说的是wordpress,那么值得一提的是问题中的事实,这是一种享受!谢谢!:)
function new_excerpt_more( $more ) {
  global $post;
  if ($post->post_type == 'testimonial'){
    return '';
  }
}
add_filter('excerpt_more', 'new_excerpt_more');