the so-called WordPress theme file invocation mechanism, that is, the hierarchy of the call relationship.
Homepage Template:
1. The home page template is usually index.php or home.php, when the visitor visits the site, WordPress will first query the subject directory for the existence of home.php, if not present, call index.php.
2. So the order of the first page template call is as follows: home.php-index.php
Category page Template:
1. The category page template is usually category.php or archive.php or index.php, when the visitor visited the page as a category page, WordPress first queries the theme file for the existence of category.php, if not exist then continue to query archive.php, if Archive.php also does not exist then call index.php.
2. The Order of Classification page template calls is as follows:
index.php, archive.php, category-{slug}.php, category.php,
Search Results page:
1. Search results pages typically use search.php or index.php
2. The order of Search results page template calls is: search.php, index.php
Custom Category page:
1. Custom Classification page decibel is taxonomy.php or archive.php or index.php
2. The order of the Custom category page template calls is as follows:
index.php, archive.php, taxonomy-{slug}.php, taxonomy.php,
tab page:
index.php, archive.php, tag-{slug}.php, tag.php,
Author Archive page:
index.php, archive.php, author-{id}.php, author.php,
Time Archive page:
date.php, archive.php, index.php
Article content page:
single-{id}.php, single.php, index.php
Individual pages:
single-{slug}.php, page.php, index.php
Attachments page:
attachment.php, single.php, index.php
404 page:
404.php-index.php
where {slug} is an alias, and {ID} is the corresponding ID
The above describes the Sinsing of WordPress theme file call mechanism, including the content, I hope the PHP tutorial interested in a friend helpful.