The Main Loop & Template Loading

  • The main query is a WP_Query object

  • The main loop is using that main query

  • The main query is done before the template is even loaded

  • The template is loaded based on what the main query is

  • The main query is determined by parameters called query variables

  • Which template is loaded when is shown on the template hierarchy diagram

  • All templates are just custom ways of showing the main post loop

Last updated