祝你好运。我有以下代码:
$args = array(
\'post_type\' => \'property\',
\'tax_query\' => array(
array(
\'taxonomy\' => \'rc_repl_status\',
\'field\' => \'slug\',
\'terms\' => \'sold\'
)
),
\'posts_per_page\' => 100,
\'meta_key\' => \'_rc_repl_property_year_sold\',
\'orderby\' => \'meta_value _rc_repl_property_acres\',
\'order\' => \'DESC\'
);
$query = new WP_Query( $args );
首先,我通过分类法过滤我的帖子类型,以查找已售出的房产(牧场列表)。下一步,我想知道他们第一次销售DESC订单的年份。接下来,我希望另一个已排序英亩的元字段(即\\u rc\\u repl\\u property\\u acres字段)也按DESC顺序排序。这一年天气很好,然后在英亩地上休息。
如下所示:
牧场ASOLD 2014英亩1300
Branch BSOLD 2014英亩1700
RANCH CSOLD 2013ACRES 800
RANCH DSOLD 2013ACRES 900
----应该是----
Branch BSOLD 2014英亩1700
牧场ASOLD 2014英亩1300
RANCH DSOLD 2013ACRES 900
RANCH CSOLD 2013ACRES 800
希望这有意义。。。请帮忙!