目的地不是按升序排序的。为什么?

时间:2017-07-27 15:47:33

标签: php wordpress

我正在从数据库中提取目的地并尝试按以下方式按字母顺序排序:

row.tds[0].text

但没有成功。为什么?

1 个答案:

答案 0 :(得分:1)

$destinations = get_posts( array(
                            'post_type' => 'destination_showcase',
                            'posts_per_page' => -1,
                            'post_status' => 'publish',
                            'orderby' => 'title',
                            'order'   => 'ASC',
                            'meta_query' => array(
                                array(
                                    'key' => 'destination_state',
                                    'value' => ':"'.$state_id . '";' , // looking for serialized value in quotes
                                    'compare' => 'LIKE'
                                )
                            ),

                        ) );

尝试订单更改