CPT archive link takes me to blog page
-
Hi
I’ve spent several days googling this and searched here too with no joy. I’m using Genesis with a custom child theme based on Genesis Sample, posting here as this is a WP issue I think. My PHP skills are beginner/improver level at best.
I’ve set up a CPT and 2 custom taxonomies for it (both categories, no tags) in a basic plugin, with a single-cpt and an archive-cpt template. The taxonomy links have a template redirect to use the archive- template. The CPTs generally work as intended, except…
The 2 categories are displayed/linked in the entry-meta/post footer, but there’s a problem with the resulting links. The first category links to the correct archive (which is using the archive-cpt template as intended), but the second category – despite the permalink being correct e.g. website/taxonomy2/term – takes me to the blog page, using index.php as the template.
Is this a permalink problem? I’ve flushed the permalinks many times, no difference. It is producing the right path, so probably not this.
Is it a template problem? I can’t see how it would be as both taxonomies are essentially identical in the way they are registered, both were added at the same time, both are redirected to the same template and both work in all respects except this. The permalink for the second category is correct so the redirect is working.
I’m confused as I’ve used a very similar setup elsewhere with no issues (different theme and slightly different implementation).
Any help much appreciated, even just the right thing to search for would help, I’m not sure what the problem is. Happy to post code excerpts but I’m not sure what is relevant to this yet. All plugins, themes etc. are up to date.
Many thanks.
- The topic ‘CPT archive link takes me to blog page’ is closed to new replies.