2017-08-01 57 views
-1

我想通过meta_key和meta_value筛选我的结果。通过meta_value和meta_key进行筛选

我有一个视频共享网站,我想过滤结果只是在罗马尼亚视频。

我尝试使用此代码:

query_posts(array('post_type' => array('episodes'), 'meta_key' => 'idioma', 'meta_value' => 'td','meta_compare' => 'IN')); 

不过,我想只显示与meta_key idioma和meta_value与TD的结果。

这是我的数据库:

https://prnt.sc/g2u38e

我尝试用这个ARG:

$args = array(
    'post_type' => 'array ('episodes')', // Here is the type of posts, you told me I'm on array ('episodes') 
    'post_status' => 'publish', // If you have a post status, I assumed you would publish 
    'orderby' => 'td', // Ordered after meta_value and after meta_key 
    'meta_key' => 'idioma', // Custom meta_key name 
    'order'=> 'DESC' // sort descending 
); 

但它不工作。

+0

看看http://php.net/manual/en/function.array-filter.php – Pete

回答

1
change this 
'post_type' => 'array ('episodes')', 
to 
'post_type' => 'episodes', 
or 
'post_type' => 'array ("episodes")', 
+0

我会尽力,非常感谢你。我给你一个反馈。 – Kerossen2K

+0

欢迎Kerossen2K – Prince

+0

我在这里添加更正的arg https://prnt.sc/g2v01v蝙蝠它不能工作,这是旧图片,蝙蝠我纠正了post_type值。你能帮我吗?并告诉我为什么不工作?非常感谢你的帮助。 – Kerossen2K

相关问题