The native logic of template choice is contained in file aptly named template-loader.php
. It processes the current context and calls respective get_*_template()
functions, until a match is found.
This process results in what is called Template Hierarchy.
However as it was pointed out this only covers native core logic. Plugins can wildly customize this process at different stages or skip it altogether.
Related Posts:
- Prevent menu from loading in a page template [duplicate]
- How to add class and span to
- wp_nav_menu: show menu only if one exists, otherwise show nothing
- How to modify navigation menu of the “My Account” page in WooCommerce
- How to get IDs for objects in menu branch?
- Add child pages automatically to nav menu
- Automatically remove trashed pages from nav menu
- Dynamically link to the latest post or simulate request of specific post in page template
- Directing a page to a default subpage
- Can you have different menus and theme on a per-page basis?
- List children of second level sub page
- How to make pages metabox display all hierarchy in menu admin?
- Remove navigation from header in custom page template
- Hide pages depending on role
- Get parent page/menu id of current post
- Show all parent pages and their children below from same author as currently viewed page
- Change menu items URL
- Making WordPress’ page and menus visible only for logged in users, checking session variables
- Different side menu on each page
- WordPress – site with 2 stylesheets and more…
- Remove Page Name From WordPress Menu
- Hiding Menu From Specific Pages
- Getting post content within wp_nav_walker
- wp_list_pages sort order is different for different languages [closed]
- Auto add pages to primary menu with functions.php
- Does loading of sub pages in menu cause load to the server?
- WordPress menu permalink redirects to wrong page
- Link to Homepage in Menu
- Schedule Page to Menu [duplicate]
- Add class active to static menu
- wp_list_pages() but only show children on the branch you are on
- How do I render a navigation menu like my theme does?
- Check if Page Already Exists in Menu
- Programmatically add existing pages and subpages to Appearance Menu
- two different separate sections on the same site
- When clicking on menu item not going to specific page
- Ad custom admin page like WordPress customizer [closed]
- Displaying different page links on different pages
- pull non-wp site into content area of wordpress -or- pull wp header into non wp site?
- Create custom page and add it in nav menu by code
- Does is_child() exist in wp 3.5.1?
- wp_list_pages sort order by custom nav menu order
- How can I switch pages?
- How to create a menu item which is not a page
- How can I make a menu link visible only to admins (without plugins)?
- How to add a page to header that is outside of WordPress?
- How to Structure Pages and Subpages
- Highlighting top level link when viewing one of it’s sub-pages, which are not linked in the menu
- Three menus – parent / child / sibling
- unable to add custom page/tab to my account woocommerce
- Add (grand)child pages automatically to nav menu
- how avoid the link of the current post in the menu in the sidebar?
- Disable parent in wp_list_pages – WordPress
- Page appears after de registering from menu
- Get parents child pages
- Menu not adding the right items
- Dynamic menu wp_list_pages displaying only current branch including: current page, his siblings and its childs
- wp_nav_menu without menu or theme_location specified
- I can’t add more pages to menu – menu delete pages
- wp_list_pages Hierarchical Help
- Parent Page > Child Page Menu
- Making pages in a menu appear conditionally
- Add pages content to startpage through custom menu
- add_menu_page does not render the expected result
- Wp_list_pages not showing children with custom page template
- Main menu navigation links and new pages
- Page header menu links change
- Catagorized hierarchy menu for PAGES!
- How to show pages in menu without link
- Add a menu metabox to post edit page
- Setting or plugin for showing submenus horizontally under the main menu, and keep them after selection
- Add prefix to url, but products not showing in page SHOP
- adding pages in underscores.me theme
- How to get the Page Name of the current page?
- Swap out a page that is a parent to a many many pages
- Add CSS Class to WordPress Menu Item Dependent on the Page the User is Visiting
- How can I order these pages in this navigation bar on this old wordpress theme?
- Admin: WooCommerce Navigation Menus do not show empty categories search tab
- WP pages content is missing in frontend
- Importing large product categories into wordpress menu
- Unable to remove page from primary menu
- how to create pages and link them to a menu
- Menu’s built in the edit theme view do not have active states set when on child pages
- How to sort a sub-menu, generated with get_pages(), by the page order instead of alphabetically?
- Any simple way to show 10 previous pages by id to current page in links as a menu
- Add a non-dynamic phrase/character after a page title?
- WordPress – Apperance > Menu
- Creating and populating custom nav menu (menu-item-position not working)
- Programatically retreive page content from its template page
- How to make a page to not appear in the menu when created?
- Custom Menu based off custom header
- Two pages named the same thing, on a different level but conflicting url paths in menus and direct links
- Site with all content on the front page
- Adding Pages to Menus – No Page Hierarchy in Backend [duplicate]
- Some informations about the use of statics pages in WordPress
- How can I make this process automatic?
- my theme automatically adds new pages to menu
- how can i get the page_ID in nav li [closed]
- Problems with draft website pages
- Add a page to a subscribers account