Wordpress WP_Query呼叫帖子和页面
问题描述:
我设置了一个功能滑块,以绘制标记为功能"的帖子
I have a feature slider set up that draws in posts that are tagged 'feature'
$my_query = new WP_Query(array(
'showposts' => 3,
'tag' => 'feature' ));
是否可以绘制帖子和页面?
我知道您可以使用'post_type'=>'page'
绘制页面,但是可以将两者混合吗?
Is is possible to draw in posts AND pages?
I know you can draw pages with 'post_type'=>'page'
but can you mix the two?
答
@fivedigit 谢谢,但是我同意了结束:
@fivedigit Thanks but I went with this in the end:
$my_query = new WP_Query(array(
'post_type' => array('any'),
'tag' => 'feature'
));
尽管您的版本将来可能会派上用场!
Although your version may come in handy in the future!