Opened 11 years ago
Closed 10 years ago
#35477 closed enhancement (wontfix)
archive-$post_type.php in get_taxonomy_template
| Reported by: | sebastian.pisula | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Themes | Version: | |
| Severity: | normal | Keywords: | close |
| Cc: | Focuses: | template |
Description
I have custom post type and archive. In archive-post_type.php I have template. But this CPT have a taxonomy. Template in taxonomy is identical to archive-post_type.php so I make taxonomy-taxonomy.php with content:
<?php get_template_part( 'archive', 'post_type' );
But I think that WordPress should load archive-post_type.php.
Attachments (1)
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
archive-{$post_type}.phpis already used inget_archive_template()for post type archives. Using the same template inget_taxonomy_template()would lead to unintended effects.In
get_taxonomy_template(), the post type of every post can theoretically be different, so loading a template for a specific post type associated with the taxonomy is not possible.What you're currently doing should be fine and is not wrong.