It occurs in 3 principal levels:
- The URL is parsed by
WP::parse_request()that is finished by matching the URL to WordPress’s rewrite guidelines. You possibly can see these guidelines within therewrite_ruleschoice within thewp_optionsdesk, or use a plugin
like Rewrite Guidelines Inspector to browse them. This ends in parameters forWP_Query. - The parsed parameters are handed as arguments to the ‘principal’ world occasion of
WP_Query, which queries the database for posts. The Loop is for looping by means of the posts returned by this question. - Primarily based on the arguments handed to the
WP_Queryoccasion numerous properties resemblingis_singleoris_archiveare set on the question object byWP_Query::parse_query(), and primarily based on these propertieswp-includes/template-loader.phpwill load a template file out of your theme. How templates are selected, i.e. the template hierarchy, is visualised right here.
For many day-to-day improvement solely step 3 is absolutely related, and it must be pretty apparent from the URL what posts are going to be loaded:
/my-pageThe web page with themy-pageslug./class/my-categoryPosts within themy-categoryclass./2020/03/01Posts from March 1st 2020.?s=my+search+time periodPosts matching the search question “my search time period”.
You possibly can normally infer all these URLs primarily based on what the View hyperlinks for numerous forms of content material within the admin space level to.
Whenever you register customized put up sorts and taxonomies there will likely be a rewrite argument that permits you to outline what the URL to an archive of these posts will likely be. Discuss with the documentation for a way these work.
The vital factor to notice is that by default, other than the 404 template, all URLs created by WordPress will load both a single put up, or an inventory of posts.

