This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action('pre_get_posts', function ($query) { | |
| if ( | |
| !is_admin() && | |
| // for me I commented this out in the end as my ajax grid sort by query was going back to a smaller set of results | |
| // but it is risky, as it could affect other parts of the site like related posts, or sidebar widgets | |
| // test it out on your site, and if it breaks then you will need to dig in and find a way to detect which query | |
| // to filter: | |
| // $query->is_main_query() && |
OlderNewer