Php Wordpress使用附加参数分页

Php Wordpress使用附加参数分页,php,wordpress,isset,pagination,Php,Wordpress,Isset,Pagination,下面的代码非常适合为我的自定义帖子搜索结果分页: if( isset($_GET['pagination']) && $_GET['pagination'] != 'false'){ $arguments['posts_per_page'] = -1; $pagination = 'true'; } else { $arguments['posts_per_page'] = 9; $pagination = 'false'; $

下面的代码非常适合为我的自定义帖子搜索结果分页:

if( isset($_GET['pagination']) && $_GET['pagination'] != 'false'){
    $arguments['posts_per_page']    = -1;
    $pagination = 'true';
} else {
    $arguments['posts_per_page']    = 9;
    $pagination = 'false';
    $arguments['order'] = 'ASC';
    $arguments['meta_key'] = 'code_auto';
    $arguments['orderby'] = 'meta_value';
} 
但是,如果有人使用以下方法过滤结果:

if( isset($_GET['sort_price'])){
    $sort_price = $_GET['sort_price'];
    if($sort_price == 'ASC'){
        $arguments['order'] = 'ASC';
        $arguments['meta_key'] = 'price-6';
        $arguments['orderby'] = 'meta_value';
    } else {
        $sort_price = '';
        $arguments['order'] = 'DESC';
        $arguments['orderby'] = 'DATE';
    }
}
结果分页,但不包括排序价格查询。有谁能重写一下,把这两个论点都包括进去,因为我已经试过很多次了,但都不太明白。谢谢大家!