4
votes

i need to customize my category.php template 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).

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

Any suggestion?

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

1
what you are asking here is quite broad and not specific. have you tried going to the category.php to customize. and if you have any problem, come back and ask. - bingjie2680
Did you try category-slug.php? You can use slug or id to create different template for each category. See here for more reference codex.wordpress.org/Category_Templates - Vasanthan.R.P
@ Vasanthan non posso farlo, perché la lumaca (categorie alias) vengono creati dal proprietario del sito web e non sono fisse. Ho bisogno di someting come categoria posttypeslug.php @bingjie2680 i try to be more specific: i have some cats attached to 2 CPT, i need to show in different ways the pages "category x" depending of one or other CPT. the problem is that the template category.php is only one. The category.php is a grid of products, each linked to the single detail page (done). - Lanny

1 Answers