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