开发者

How to query posts for a custom post type in a custom taxonomy ? in wordpress 3.0

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开发者_如何学C 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");


I woke up this morning and tried it again. It works, why? ... nevermind. Maybe working too late into the night.

$recent = new WP_Query("age_group=test&post_type=toy");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜