不同分类和文章类型调用不同文章页Single
按自定义文章类型型调用: single-{post-type}.php 自定义单独页面模板。例如, single-portfolio.php 展示自定义文章类型为 portfolio 的文章. 如果文章类型未被设置则使用index.php。 按文章分类调用: 主题的single写成如下: if ( in_category('poetry')) { include(TEMPLATEPATH .'/single-poetry.php'); } else{ include(TEMPLATEPATH . '/single-all.php'); } 另外还需要一个single-poetry.php放置分类为poetry的文章和single-all.php来放置其他文章的文章页模板。 新增规则则加入 elseif 判断。 最后就有下面的这些single模板: