Wordpress:为不同的自定义帖子类型使用自定义类别模板(category.php)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8354373/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:50:13  来源:igfitidea点击:

Wordpress: use custom category template (category.php) for different custom post type

wordpresstemplates

提问by Lanny

i need to customize my category.phptemplate depending of which custom post type the cat is attached (assuming every post type has dedicated categories, not shared between pt, and dynamically created by site admin user).

我需要category.php根据猫所附加的自定义帖子类型来自定义我的模板(假设每个帖子类型都有专用的类别,不在 pt 之间共享,并且由站点管理员用户动态创建)。

Alternative to this can be load different template (category-slug.php?) but codex says category.phpis only and one.

对此的替代方案可以加载不同的模板(category-slug.php?),但 codex 说category.php只有一个。

Any suggestion?

有什么建议吗?

Solved by a link provided by Vasanthan.R.P https://wordpress.stackexchange.com/questions/10099/custom-post-types-on-category-pages

由 Vasanthan.RP https://wordpress.stackexchange.com/questions/10099/custom-post-types-on-category-pages提供的链接解决