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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -