This file (/wp-includes/template-loader.php) does the following:
Note: At this point, the WordPress environment is fully loaded.
wp-load.php loads wp-config.php, which in turn loads
wp-settings.php to set up constants, globals, and plugins.
- Checks if themes are being used via
wp_using_themes().
- If themes are enabled, determines the correct template file to load based on the template
hierarchy (e.g.,
index.php, single.php,
page.php).
- Loads the selected template, which outputs the page content.