WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type Archive Page (13 posts)

  1. reedbird8
    Member
    Posted 11 months ago #

    I've created a custom post type "breeding_projects" with the help of Types plugin. I've also created two custom taxonomies associate with this post type "breeder" and "genus".

    I've created templates single-breeding_projects.php and archive-breeding_projects.php

    The single template works great. Everything functions perfectly there displaying the content as I'd like. However, the archive template doesn't even get used. My archive for this post type keeps wanting to use archive.php instead. I'm now stuck on how to get it to be used. I can't even see if my template needs changed since it won't access my template.

  2. Keith Driscoll
    Member
    Posted 11 months ago #

    You need to edit the custom post type and set 'has_archive' to 'true'. It's an advanced setting :)

  3. reedbird8
    Member
    Posted 11 months ago #

    Thanks, Keith, but that's already set.

    It HAS an archive and displays. It just doesn't use the template I designed for it. I'm trying to figure out why it uses the standard archive.php template instead of the archive-breeding_projects.php template.

  4. keesiemeijer
    moderator
    Posted 11 months ago #

    Does the archive-breeding_projects.php template have a custom page template header?
    http://codex.wordpress.org/Page_Templates#Custom_Page_Template

    If so remove it.

    try:
    - switching to the default theme to rule out any theme-specific problems.

  5. reedbird8
    Member
    Posted 11 months ago #

    keesiemeijer -

    Removed the header, still no luck. I guess I can try switching themes tomorrow morning. Could you shed light on what from a theme may cause the issue? (So I know what to hunt for if that is the problem)

    Thanks

  6. keesiemeijer
    moderator
    Posted 11 months ago #

    Try re-saving your permalink structure in wp-admin > Settings > Permalinks.

    There are many ways to alter the default template. Look for something like "template_include".
    http://codex.wordpress.org/Plugin_API/Filter_Reference/template_include

  7. reedbird8
    Member
    Posted 11 months ago #

    Thanks. I'll hunt for that kind of stuff. Had already tried re-saving permalinks, bit I'll try it again. I've done some other things since then to try to sort things out.

  8. reedbird8
    Member
    Posted 11 months ago #

    No luck on the permalinks.

  9. keesiemeijer
    moderator
    Posted 11 months ago #

    Thing to try:

    - flushing any caching plugins you might be running, as well as server and/or browser caches.

    - deactivating all (other than the types) plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the default theme to rule out any theme-specific problems.

  10. reedbird8
    Member
    Posted 11 months ago #

    Didn't think to flush supercache. Great call there.

    Thole plugins and themes are the last steps I often take, just cause of how much that "shuts down" my site. But they are on my list.

    Thanks for all the help. It also sounds like, in theory, my post type and taxonomy setup is right, there's just something else keeping it from working.

  11. reedbird8
    Member
    Posted 11 months ago #

    Flushing cache didn't work, either....I love a mystery...

  12. Keith Driscoll
    Member
    Posted 11 months ago #

    Try activating Twenty Thirteen and rename archive.php to archive-breeding_projects.php. If that doesn't work I would check here: http://codex.wordpress.org/Template_Hierarchy

  13. reedbird8
    Member
    Posted 11 months ago #

    Keith -

    That helped. If i rename it taxonomy-{taxonomy}.php, it does the trick!

Reply

You must log in to post.

About this Topic