我尝试通过自定义字段(电机)按此值排序,但这不起作用。你能帮助我吗?我使用acf来创建自定义字段。当我执行var_dump时,它无法通过参数识别顺序。
$args='';
$args = array(
'post_type' => 'grupoelectrogeno',
'post_status' => 'publish',
'posts_per_page' => '100',
'meta_query' => array(
array(
'key' => 'potencia_continua',
'value' => $postpotencia,
'compare' => 'like'
),
array(
'key' => 'motor',
'value' => $postmotor,
'compare' => 'like'
),
array(
'key' => 'version',
'value' => $postversion,
'compare' => 'like'
),
array(
'key' => 'gama',
'value' => 'industrial',
'compare' => 'like'
),
'orderby' => 'motor',
'order'=>'desc',
),
);