I’m afraid John I don’t understand what this means, I don’t understand anything about queries / $query – this template is from a third party.
All I do know is that adding
if (is_admin() || !$query->is_main_query()) {
return;
}
to the add_action...
code caused this…
Would you be able to explain what you’ve said in a few more steps please?