0
我有點失落與這一個。分類和自定義文章類型訂單
我想爲我的自定義分類標準制作一個索引頁,我有99%的工作,但是它忽略了orderby並以張貼的日期順序顯示帖子。
$number_of_posts = intval(get_option('theme_number_posts_agent'));
$get_county = get_terms(
'new_developments',
array(
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
)
);
if(!$number_of_posts){
$number_of_posts = 3;
}
foreach ($get_county as $get_countys) {
$agents_query = array(
'post_type' => 'agent',
'posts_per_page' => $number_of_posts,
'paged' => $paged,
'orderby' => 'title', 'order' => 'ASC',
'tax_query' => array(
array(
'taxonomy' => 'new_developments',
'field' => 'slug',
'terms' => $get_countys
)
)
);
$agent_listing_query = new WP_Query($agents_query);
if ($agent_listing_query->have_posts()) :
while ($agent_listing_query->have_posts()) :
$agent_listing_query->the_post();
我在兩個地方放置排序依據下get_terms並在wp_query但沒有...
任何幫助,將不勝感激大大
你看這個問題? http://wordpress.stackexchange.com/questions/14306/using-wp-query-is-it-possible-to-orderby-taxonomy – Benoti
嗯,好像看起來,有點傻,至於我與它合作將是完美的 – Aaron