我有一个页面,其中显示的帖子列表与我当前所在页面的类别相关。其工作代码如下:
$count = 7;
$terms = get_the_terms (get_the_ID(), 'filter' );
if(is_array($terms))
{
$category_filter = array();
foreach($terms as $term)
{
$category_filter[] = $term->slug;
}
}else $category_filter=array();
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
// Query Out Database
$wpbp = new WP_Query(array( 'post_type' => 'portfolio',
'posts_per_page' =>$count,
'paged' => $paged,
'tax_query' => array(
array(
'taxonomy' => 'filter',
'field' => 'slug',
'terms' => $term
)
)
)
);
现在,我不想将帖子限制在我所在页面的当前类别,而是首先显示这些帖子,然后在我的自定义帖子类型中显示其余帖子。如何设置orderby语句?提前谢谢。