Still not working! I have added this in each filter
if(is_front_page() && empty($sort)) {
filter code executed;
}
and these filters are at the bottom of my functions.php file. I also added this code to the top of my index.php file:
global $sort;
$sort = 1;
so that on the first page request for the homepage the initial filter is fired. Also above the add_filter's in my functions.php
I have:
if(isset($_GET['sort'])){
$sort = $_GET['sort'];
}
This should fire the filter if its the homepage or if the sort variable is populated in the $_GET array, otherwise it would be a normal page and the default query should run. When I click on posts that aren't in my custom fitlers, I get a page not found message and in the wp-admin dashboard for all posts, only posts from the filters are returned which is not correct. I am so desperate for help! Please dont get frustrated with me, I just don't know if I am adding the code in the right files.