Here is what I am trying to accomplish:

enter image description here

Which partly works already, I can sort with 2 dropdowns and have a pagination.
I have to merge both dropdowns into one, and add "posts per page" without screwing up the pagination.

Currently I'm using WP-PageNavi for the pagination

Current code:

$orderby = $_GET['orderby'];
$order = $_GET['order'];

<form action="" method="get">
    <select name="order" id="order">
        <option value="asc" <?php if ($order == "asc"){ echo 'selected="selected"'; } ?> >ASC</option>
        <option value="desc" <?php if ($order == "desc"){ echo 'selected="selected"'; }?> >DESC</option>
    <select name="orderby" id="sorting">
        <option value="title" <?php if ($orderby == "title"){ echo 'selected="selected"'; } ?> >Title</option>
        <option value="date" <?php if ($orderby == "date"){ echo 'selected="selected"'; }?> >Date</option>
    <input type="submit" value="Submit" />

<?php if(function_exists('wp_pagenavi')){wp_pagenavi();} ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.