Build Your Own Business Website header image

pre_get_posts () filter

How to Change the Sort Order of Specific Category and Tag Archive Pages

Difficulty Level -

Filed Under Topics - , , ,

Listed Under Lesson Subjects -

In this session we show how to change the sort order of specific category and tag archive pages using the WordPress pre_get_posts () filter which intercepts the query after it’s formed but before it is executed and gives the opportunity to change named query variables. We write a code to limit the scope of change