0
votes

I'm using Types plugin for create a Wordpress Custom Post Type (CPT), now I need to customize the archive page for that CPT and also the category page and I'm asking how do I achieve this? I've read this docs from Wordpress Codex site about the template hierarchy but is not clear to me at all how many templates I should create and how should be named.

Let me explain now what I have done: the CPT is called legislaciones and have create a page called category-legislaciones.php that file works for a URL like /category/legislaciones/ but what about the archive? what about the result on this URL /category/legislaciones/legislacion-1-ley? How do I customize that pages?

2

2 Answers

1
votes

For archive page you have to create taxonomy page for CPT category by naming like

taxonomy-legislaciones.php
1
votes

For a custom taxonomy named legislaciones (p.s. you may have issues with a capitalized slug), per the Template Hierarchy, the taxonomy archive index template file is taxonomy-{taxonomy}.php, or taxonomy-legislaciones.php

For a custom post type named like books (p.s. you may have issues with a capitalized slug), per the Template Hierarchy, the post archive index template file is single-{post_type}.php, or single-books.php.