Analysis on the calling mechanism of WordPress theme files

Source: Internet
Author: User
: This article mainly introduces the calling mechanism of the WordPress theme file by Xin Xing. if you are interested in the PHP Tutorial, refer to it. The so-called WordPress topic file calling mechanism is the hierarchical relationship of calls.

Homepage template:

1. the homepage template is usually index. php or home. php. when a visitor accesses the site, WordPress first queries whether home. php exists in the topic directory. if not, index. php is called.

2. the order of homepage template calls 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 a visitor accesses a page of classification, WordPress first queries whether category exists in the topic file. php. if it does not exist, query archive. php, if archive. if php does not exist, index is called. php.

2. the order of template calls on the classification page is as follows:

Category-{slug}. php-> category. php-> archive. php-> index. php

Search result page:

1. search result pages usually use search. php or index. php

2. the order of template calls on the search result page is: search. php-> index. php

Custom category page:

1. the custom classification page is taxonomy. php, archive. php, or index. php.

2. the order of template calls on the custom classification page is as follows:

Taxonomy-{slug}. php-> taxonomy. php-> archive. php-> index. php

TAB:

Tag-{slug}. php-> tag. php-> archive. php-> index. php

Author Archive page:

Author-{id}. php-> author. php-> archive. php-> index. php

Time Archive page:

Date. php-> archive. php-> index. php

Article content page:

Single-{id}. php-> single. php-> index. php

Separate page:

Single-{slug}. php-> page. php-> index. php

Attachment page:

Attachment. php-> single. php-> index. php

Page 404:

404. php-> index. php

{Slug} is the alias, and {id} is the corresponding ID.

The above introduces the calling mechanism of the WordPress theme file by Xin Xing, including some content, and hopes to help those who are interested in the PHP Tutorial.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.