What hook is executed just after wp_query has been executed?

What hook is executed just after wp_query has been executed? before template is rendered? I want to change the page title but it depends on what has been queried.

I have put it in template_redirect but not sure if it is the right hook

2 Answers
2

Yep you’re right template_redirect is fired right after wp which performs the query.

A very useful plugin you might want to look at is: https://wordpress.org/plugins/query-monitor/

This can help you to see what’s loaded on a particular page during development, in addition to what hook is used

Leave a Comment