Tagged: x
-
AuthorPosts
-
May 14, 2016 at 8:38 pm #991769
BaroninnParticipantHi there guys.
Was wondering if you could take few moments to brainstorm my problem with archive-{post-type}.php
I cant get archive{post-type}.php to work in a term or child term.From my understanding , I should copy wp-index.php from my current stack and rename it to archive-posttype.php
that works… ok..
when I visit http://my-site.com/posttype/ I get my custom archive page.. great ..But when I visit a term within a taxonomy from that post type I get the default index.php.
My permalink structure is /%category%/%postname%/
So when I click the term I get http://my-site.com/taxonomy/termI guess that’s because of my permalink structure.
And I also guess thats the reason I dont get my custom archive-{post-type}.phpIm banging my head against the wall here.
I cant get archive{post-type}.php to work in a term
Any ideas would be very helpful.
I hope you dont say thats beyond the scope of…. 🙂Best regards
BaroninnMay 14, 2016 at 9:07 pm #991791
BaroninnParticipantWow… I cannot beleve I figured it out 3 minutes after I posted this.
I have been slamming my head against the wall for weeks about this…The solution :
First off.. If anyone is having this issue, study the template hierarchy .. i didnt .. 🙂If you need the archive-posttype.php to work in your child term or taxonomy within the post type.
copy that archive-posttype.php file and rename the copy to be as :
taxonomy-{taxonomy}.php
or
taxonomy-{taxonomy}-{term}.phpSo, let’s say you have a CPT named “Projects,” a taxonomy named “Maintenance,” and a term within the taxonomy named “Professional.” Then your naming convention would be:
taxonomy-maintenance-professional.php
this should also work :
taxonomy-maintenance.phpI hope this helps someone….
Best regards
BaroninnMay 15, 2016 at 1:50 am #991920
ChristopherModeratorThank you for sharing the solution 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-991769 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
