正在载入...

当wordpress载入页面/内容时,它会查找你的主题文件夹并根据命名载入正确的模板页面,Wordpress调用不用的页面/内容,wordpress的查找顺序如下:

  • 404
    1. 404.php
    2. index.php
  • Search
    1. search.php
    2. index.php
  • Tax
    1. taxonomy-{tax}-{term}.php
    2. taxonomy-{tax}.php
    3. taxonomy.php
    4. archive.php
    5. index.php
  • Home
    1. home.php
    2. index.php
  • Attachment
    1. mime.php
    2. type.php
    3. mime_type.php
    4. attachment.php
    5. single.php
    6. index.php
  • Single
    1. single-{post-type}.php
    2. single.php
    3. index.php
  • Page
    1. custom_template.php
    2. page-{slug}.php
    3. page-{id}.php
    4. page.php
    5. index.php
  • Category
    1. category-{slug}.php
    2. category-{id}.php
    3. category.php
    4. archive.php
    5. index.php
  • Tag
    1. tag-{slug}.php
    2. tag-{id}.php
    3. tag.php
    4. archive.php
    5. index.php
  • Author
    1. author-{author-nicename}.php
    2. author-{author-id}.php
    3. author.php
    4. archive.php
    5. index.php
  • Date
    1. date.php
    2. archive.php
    3. index.php
  • Archive
    1. archive.php
    2. index.php

WordPress页面/内容函数对应的模板,WordPress加载模板的机制如下图:

本文链接:

关键词:WordPress, 互联网, 代码, 软件,

(全文完        )

Comments

哈哈,沙发有木有?!!!抢沙发快速评论