【发布时间】:2016-11-07 14:50:44
【问题描述】:
我正在收集统计数据,我想在那里显示我拥有的所有页面、帖子、分类类别。
我可以显示帖子类型和页面,因为实际上它们都有一些帖子类型,但不能同时显示分类类别:
<?php
$excluded_ids = array(1, 5);
$postArgs = array(
'post_type' => array('page', 'products'),
'order' => 'ASC',
'orderby' => 'title',
'post__not_in' => $excluded_ids,
'posts_per_page'=> -1,
/*'taxonomy' => 'product-category'*/
);
$postList = get_posts($postArgs);
?>
有没有办法通过单个查询而不是多个查询来显示所有内容(帖子、类别、页面)?有什么想法吗?
【问题讨论】:
标签: php wordpress custom-post-type