It turns out the cause of this lingering filter problem was to do with the way WordPress was set up as well as the argument of WP_Query
. Once I changed the Your Homepage Displays setting to the latest posts and renamed front-page.php
to be index.php
, the filter began working and the blank page no longer showed.
Concerning the post filter, declaring the orderby parameter as part of the argument of WP_Query
got it working. The code for the filter is as follows:
<form class="post-filters">
<select name="orderby">
<?php
$orderby_options = array(
'post_date' => 'Order By Date',
'post_title' => 'Order By Title',
'rand' => 'Random Order'
);
foreach($orderby_options as $value => $label):
echo '<option '.selected($_GET['orderby'], $value, false).' value="'.$value.'">'.$label.'</option>';
endforeach;
?>
</select>
<input type="submit" value="Filter">
</form>