首页 文章

自定义帖子类型模板

提问于
浏览
1

我有一个自定义的帖子类型“食谱” . 我使用自定义帖子类型UI插件创建它 .

名称是ic_recipes,标签是Recipes,重写slug是食谱

网址形成为mysite.com/recipes/lentil-soup/

这是问题......

我想为这个自定义帖子类型创建模板文件以供使用..

但无论我怎样尝试,wordpress最终都使用了single.php .

我已将以下文件提供给twentyten主题文件夹;

recipes.php
ic_recipes.php
archive-recipes.php
and finally archive-ic_recipes.php

没有人踢过.one.php每次都是那个 .

我检查了手抄本 . codex有关于模板命名的以下内容(我在这个问题的底部复制/粘贴)!

请告诉我,我错过了什么..

http://codex.wordpress.org/Template_Hierarchy#Custom_Post_Types_display

自定义帖子类型显示

archive-{post_type}.php - If the post type were product, WordPress would look for archive-product.php.
archive.php
index.php

1 回答

  • 1

    archive-xxx.php用于存档 . 您希望使用single-xxx.php作为single.php的替代 .

相关问题