php - Wordpress Paginate with additional Parameters -
the code below works great paginating custom post search results:
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'; }
however, if has filtered results using this:
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'; } }
the results paginate don't include sort_price query. can give rewrites include both arguments have tried many times cant quite it. thank you!
Comments
Post a Comment