• Hi,

    I have a custom post type called “course”.

    In my theme I copied archive.php to archive-course.php

    According to http://codex.wordpress.org/Template_Hierarchy#Custom_Post_Type_Archive_display

    archive-course.php should override archive.php but it does not.

    I am using a custom taxonomy called “location” that is associated with the custom post type “course”. Is it because I am using a custom taxonomy that the archive-course.php is not overriding archive.php?

    I found that taxomony-location.php does work but I guess that would only work for the “course” custom post type with the “location” custom taxonomy.

    I wpould like a template that works for all “course” custom post type with all custom taxonomy.

    Please help, what am I doing wrong?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Have you tried refreshing your permalinks? I find that sometimes you need to refresh the permalinks when you register a new cpt or add a new template file.

    Simply go to the permalinks page and just hit save again, sometimes that simply does the trick.

    Thread Starter wpfan1000

    (@wpfan1000)

    Hi Evan,

    Thanks for your attention to my issue.

    I just resaved the permalinks and this does not seem to resolve the issue.

    When you registered the cpt did you add any rewrite rules?

    What does the register_post_type() function look like? You sure you didn’t name the cpt courses.

    so it’s not archive-courses.php

    Thread Starter wpfan1000

    (@wpfan1000)

    Thanks Evan I did double check and it is called course, not courses.

    Also, I am using the Custom Post Type UI plugin to create both the custom post type and the custom taxonomy, so I am not directly coding the register_post_type() function.

    ah….I’ve never used the custom post type UI plugin so I’m not entirely sure on how it works internally.

    Hopefully someone can chime in with a little more experience using it!

    Thread Starter wpfan1000

    (@wpfan1000)

    Ok but thanks Evan for your time and suggestions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Template Hierarchy issue’ is closed to new replies.