更改二十页主题的自定义文章类型的索引源外观?(wordpress)


Change index feed appearance of custom post types for twentytwelve theme? (wordpress)

这可能吗?应该如何实现?我的自定义帖子出现并运行良好,我可以自定义它的永久链接页面,但索引页面保持不变。我尝试制作一个content-[postype].php+single-[posttype].php,同时修改single-[pposttype].php文件的get_templatepart代码,但在主索引提要中查看时,它对自定义帖子类型的外观没有任何影响。

如果您想自定义Custom Post Type的归档页面,那么您还需要创建一个名为archive-[posttype].php的模板,在这个模板中,调用您已经创建的content-[posttype].php模板部分。

例如,如果你的帖子类型是"电影",那么你会创建archive-movies.php,并在其中调用它(假设content-movies.php已经存在):

<?php get_template_part( 'content', 'movies' ); ?>

一个宝贵的参考,当确定哪些模板文件使用什么是"官方"WordPress模板层次结构页面的代码:http://codex.wordpress.org/Template_Hierarchy