Wordpress主题模板层级

Singular Page:详情页

Single Post Page:Attachment Post、Custom Post、Blog Post

Static Page:Page Template

post模板文件加载顺序

$customer.php->single-post.php->single.php->singular.php->index.php

page模板文件加载顺序

$customer.php->page-$slug.php->page-$id.php->page.php->singular.php->index.php

attachment模板文件加载顺序

$mimetype-$subtype.php->$subtype.php->$mimetype.php->attachment.php->single.php->singular.php->index.php

Archive Page:归档页

Category Archive分类目录模板加载顺序

category-$slug.php->category-$id.php->category.php->archive.php->index.php

Tag Archive标签模板加载顺序

tag-$slug.php->tag-$id.php->tag.php->archive.php->index.php

Author Archive作者归档页模板加载顺序

author-$nicename.php->author-$id.php->author.php->archive.php->index.php

Date Archive日期归档页模板加载顺序

YearArchive->date.php->archive.php->index.php

MonthArchive->date.php->archive.php->index.php

DayArchive->date.php->archive.php->index.php

Site Front Page:首页

Page Shown On Front 表示在设置->阅读设置->首页指定为静态页面

Posts Shown On Front 表示在设置->阅读设置->首页指定为最新文章

Blog Posts Index Page 表示在设置->阅读设置->指定的文章页

Front-page.php->Posts Shown On Front->home.php->index.php

Front-page.php->Page Shown On Front->page-$slug.php->page-$id.php->page.php->singular.php->index.php

Blog Posts Index Page->home.php->index.php

404 Page

404.php->index.php

Search Page

search.php->index.php

Embed Page嵌入页面

embed-$post-type-$post-format.php->embed-$post-type.php->embed.php->wp-include/theme-compat/embed.php

自定义内容详情页

$customer.php->single-$posttype-$slug.php->single-$posttype.php->single.php->singular.php->index.php

自定义内容归档页

archvice-$posttype.php->archive.php->index.php

自定义分类项目归档页

taxonomy-$taxonomy-$term.php->taxonomy-$taxonomy.php->taxonomy.php->archive.php->index.php

wordpress模板层级图

wp模板层级.jpg
使用 Hugo 构建
主题 StackJimmy 设计