Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.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 如何在此函数中省略WP类别?_Php_Wordpress - Fatal编程技术网

Php 如何在此函数中省略WP类别?

Php 如何在此函数中省略WP类别?,php,wordpress,Php,Wordpress,类别标签ID为“4”。我想把这些帖子上的日期去掉。以下是在所有帖子后添加日期的代码: function add_after_post_content($content) { if(!is_feed() && is_main_query()) { $content .= '<p class="my-date-style"> '.get_the_date ('F j, Y'). '&nbsp;'.'| by Alexander Gilmour &l

类别标签ID为“4”。我想把这些帖子上的日期去掉。以下是在所有帖子后添加日期的代码:

function add_after_post_content($content) {
    if(!is_feed() && is_main_query()) {
    $content .= '<p class="my-date-style"> '.get_the_date ('F j, Y'). '&nbsp;'.'| by Alexander Gilmour </p>';
    }
    return $content;
}
add_filter('the_content', 'add_after_post_content');
函数在发布内容之后添加内容($content){
如果(!is_feed()&&is_main_query()){
$content.='

'.获取日期('F j,Y')。''124;由Alexander Gilmour编写

'; } 返回$content; } 添加过滤器(“内容”、“发布内容后添加内容”);