如何使用日期查询获取帖子数

时间:2018-08-09 14:42:27

标签: wordpress post

按日期获取特定的职位数 我有一个回调函数 但不知道如何与日期查询一起使用 函数wp_get_cat_postcount($ id){

$cat = get_category($id);
$count = (int) $cat->count;
$taxonomy = 'category';
$args = array(
  'child_of' => $id,
);
$tax_terms = get_terms($taxonomy,$args);
foreach ($tax_terms as $tax_term) {
    $count +=$tax_term->count;
}
return $count;

}

0 个答案:

没有答案