Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.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 - Fatal编程技术网

Php Wordpress上子模板的自定义摘录

Php Wordpress上子模板的自定义摘录,php,wordpress,Php,Wordpress,我一直在创建一个儿童WordPress主题。父主题是Twenty12主题 我覆盖了styles.css文件,它工作得非常好。但是我不能替换functions.php上的_摘录函数 我一直在找,但找不到解决办法 functions.php 我只是不想在链接原始帖子的摘录上显示特色图片 谢谢 我明白了!我过滤了错误的函数。我必须应用过滤器的函数是_内容。但什么时候是总结,什么时候是全部内容,这是没有区别的。如果我找到了更好的解决方案,我会添加更多信息。我这次使用函数is\u front\u page

我一直在创建一个儿童WordPress主题。父主题是Twenty12主题

我覆盖了styles.css文件,它工作得非常好。但是我不能替换functions.php上的_摘录函数

我一直在找,但找不到解决办法

functions.php

我只是不想在链接原始帖子的摘录上显示特色图片


谢谢

我明白了!我过滤了错误的函数。我必须应用过滤器的函数是_内容。但什么时候是总结,什么时候是全部内容,这是没有区别的。如果我找到了更好的解决方案,我会添加更多信息。我这次使用函数is\u front\u page解决了它。
<?php

function custom_excerpt($text) {
    return "Test";
}

function my_child_theme_setup() {
    add_filter('the_excerpt', 'custom_excerpt');
    add_filter('get_the_excerpt', 'custom_excerpt');
    add_filter('default_excerpt', 'custom_excerpt');
}

add_action( 'after_setup_theme', 'my_child_theme_setup' );

?>