如果有人能帮忙的话,我将不胜感激,因为我已经断断续续地尝试了很长一段时间,但还是无法实现。
我在循环中使用下面的函数来统计分类名称中的帖子。下面的函数工作正常,但是否有可能进一步细化该函数,以仅统计过去24小时内发布的帖子?我发现了类似的问题,但无法将其与get\\u term\\u by一起使用Count posts or custom post types from last 24 hours (or from today)
非常感谢您的帮助。
<?php
global $post;
$taxonomy = "news";
$term_name = $post->post_title;
$term = get_term_by(\'name\', $term_name, $taxonomy);
echo $term->count ;
?>