显示子类别

时间:2013-06-06 14:30:03

标签: wordpress loops categories

HI我想展示一些类别X的帖子,但仅限于此类别的帖子,但也不是儿童的类别。

global $post;
$tmp_post = $post;

$args = array( 'numberposts' =>-1, 'offset'=> 0, 'category' => 3 );     

$myposts = get_posts($args);    

foreach($myposts as $post) : setup_postdata($post);

我应该怎么做?谢谢!

1 个答案:

答案 0 :(得分:1)

尝试:

$args = array( 'numberposts' =>-1, 'offset'=> 0, 'category__in' => 3 );