Yes, it does. Pages are just a type of post.
If you visit, say, https://test.test/sample-page/
, then this happens:
- WordPress checks the URL against its stored rewrite rules.
- On a normal site,
https://test.test/sample-page/
will match(.?.+?)(?:/([0-9]+))?/?$
, which the rule maps toindex.php?pagename=$matches[1]&page=$matches[2]
. - WordPress performs a query using
WP_Query
, with thepagename
argument set topagename
. Our URL doesn’t include a page number, so it will be whatever the default is. - WordPress recognises this as a query for a single Page, and sets the appropriate values for the
is_page
,is_singular
etc. properties of the query.is_main_query
will also be true for the query based on the URL parameters. - Recognising that this is a query for a page, WordPress loads the appropriate template from the theme using the Template Hierarchy.
There’s a lot more that goes on, but this is the basic overview. A huge number of action and filter hooks are fired during this process, so I can’t list them all here, but WP_Query
related hooks like pre_get_posts
do run when viewing pages.