Modifying the main WordPress query the right way

Introducing pre_get_posts With pre_get_posts you can modify the main query anywhere on your site without ever touching a single file within your theme and pagination will continue to work as expected. pre_get_posts is an action hook that is called after the query variable object is created, but before the actual query is run. This means … Continue reading “Modifying the main WordPress query the right way”