如何在自定义分类中查询自定义帖子类型的帖子?在 WordPress 3.0 中
我一直在到处寻找,我试图查询以查找此帖子类型中具有特定分类值集的自定义帖子。
register_post_type('toy',$args);
register_taxonomy( 'age_group', 'toy', array( 'query_var' => true, 'hierarchical' => true, 'label' => __('Age Group') ) );
我该怎么做?
我尝试过这个,但没有成功。
$recent = new WP_Query("age_group=test&post_type=toy&showposts=5");
I've been looking everywhere, I'm trying to query to find the custom posts which are in this post type with a particular taxonomy value set.
register_post_type('toy',$args);
register_taxonomy( 'age_group', 'toy', array( 'query_var' => true, 'hierarchical' => true, 'label' => __('Age Group') ) );
How can I do this?
I tried this, but it didn't work.
$recent = new WP_Query("age_group=test&post_type=toy&showposts=5");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我今天早上醒来并再次尝试。有效,为什么呢? ... 没关系。也许工作到深夜。
I woke up this morning and tried it again. It works, why? ... nevermind. Maybe working too late into the night.