wordpress建站时,我们需要详细了解主题的目录结构下面每个文件的详细作用说明

主页:

       index.php home.php 这个是主题中最重要的一个文件

文章页:

       single.php     如果single.php不存在,会去找index.php
       single-vedios.php 如果文章类型是vedio,就会查找该文件

页面:

       page.php        如果不存在该文件,会去找index.php

       page-{id}.php 如果页面ID是6,WordPress将会查找page-6.php模板文件

       page-{slug}.php 如果页面的缩略名是news,就会查找page-news.php文件

分类:

       category.php 如果不存在,会去找index.php

       category-{slug}.php 如果分类的缩略名为news,将会查找category-news.php

       category-{id}.php 如果分类ID为6,将会查找category-6.php

标签:

       tag.php 如果不存在,会去找index.php

       tag-{slug}.php – 如果标签缩略名为sometag,将会查找tag-sometag.php

       tag-{id}.php – 如果标签ID为6,将会查找tag-6.php

作者:
         author-{nicename}.php – 如果作者的昵称为rami,将会查找author-rami.php
         author-{id}.php – 如果作者ID为6,将会查找author-6.php
         author.php  如果不存在,找index.php

日期页面:
         date.php
         index.php

搜索结果:
         search.php
         index.php

404 (未找到)页面:
         404.php
         index.php

附件页面:
         MIME_type.php – 可以是任何MIME类型 (p_w_picpath.php, video.php, audio.php, application.php 或者其他).

也就是说index.php 页面是很重要的一个页面,所有找不到的文件最后都会去找index.php文件