php ASCII WordPress模板层次结构

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php ASCII WordPress模板层次结构相关的知识,希望对你有一定的参考价值。

<?php
/*

WordPress Template Hierarchy (as of WordPress 4.9)


is_404() -------------------------------------------------------------------------------------------------> 404.php
is_search() ----------------------------------------------------------------------------------------------> search.php
is_front_page() ------------------------------------------------------------------------------------------> front-page.php
is_home() ------------------------------------------------------------------------------------------------> home.php

is_attachment() ---------> {mime-type}.php -----------------> attachment.php ---------\
is_single() -------------> single-{post_type}-{slug}.php ---> single-{post_type}.php --> single.php -----\
is_page() ---------------> page-{slug}.php -----------------> page-{id}.php -----------> page.php --------> singular.php

is_post_type_archive() --> archive-{post_type}.php ----------------------------------------------------\
is_tax() ----------------> taxonomy-{tax}-{slug}.php -------> taxonomy-{tax}.php ------> taxonomy.php --\
is_category() -----------> category-{slug}.php -------------> category-{id}.php -------> category.php ---\
is_tag() ----------------> tag-{slug}.php ------------------> tag-{id}.php ------------> tag.php ---------> archive.php
is_author() -------------> author-{nicename}.php -----------> author-{id}.php ---------> author.php -----/
is_date() ---------------> date.php --------------------------------------------------------------------/

is_embed() --------------> embed-{post_type}-{format}.php --> embed-{post_type}.php ----------------------> embed.php


*/

以上是关于php ASCII WordPress模板层次结构的主要内容,如果未能解决你的问题,请参考以下文章

PHP Wordpress类别层次结构

PHP Wordpress选择性页面层次结构

分类层次结构不起作用 [Wordpress]

WordPress中具有自定义帖子类型的单个页面的层次结构

Wordpress选择性页面层次结构

php Wordpress模板的结构化数据