最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp query - WordPress post_status and meta_query

programmeradmin2浏览0评论

I created a custom post status and I would like to set auto-change (clients are filling two dates, precomming and ongoing).

How can I do auto-post-status change when it is after precomming or ongoing date?

I'm also trying to do my own post listing filter: When I'm filtering by custom field it's all good, but I can't filter by taxonomy called job_listing_category.

If guests select art category then show just art category posts:

$cat = get_terms('job_listing_category');
$cat_array = array();

foreach($cat as $cat){
  if($value == $cat->slug) {
    $cat_array[] = $cat->slug;
  }
}

$meta_query = array(
  'tax_query' => array(
    'taxonomy' => 'job_listing_category',
    'field'    => 'slug',
    'terms'    => $cat_array
  )
);

But idk know why it's not working (even my $cat_array is not null, I get art cat there).

发布评论

评论列表(0)

  1. 暂无评论