Forums

Custom Archive Theme for Custom Post Types? (5 posts)

  1. mark-up
    Member
    Posted 5 months ago #

    Hello everybody! :-)

    I've some bad trouble with templates for custom post types:
    I'd like to list the contents of my custom post type called 'projects' with a special template 'archive-projects.php' (I think that's the correct name?) but the content is always deployed by the index.php-template (not even the archive.php):-(
    Is there some global setting for this? What can be problem?

    BTW: The single-templates work fine (for example single-projects.php)!

    Thank you for your time and help!
    Mark

  2. keesiemeijer
    moderator
    Posted 5 months ago #

    'archive-projects.php' (I think that's the correct name?)

    Yes it is if you registered your custom post type as "projects" with register post type

    http://codex.wordpress.org/Template_Hierarchy#Custom_Post_Types_display

    Have you tried:
    - deactivating all 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).

  3. keesiemeijer
    moderator
    Posted 5 months ago #

    Did you register your post type with: 'has_archive' => 'true';

  4. mark-up
    Member
    Posted 5 months ago #

    Hey keesiemeijer,

    'has_archive' => true

    was the solution. You'r my hero of the day!
    Thank you so much! :)
    Mark

  5. keesiemeijer
    moderator
    Posted 5 months ago #

    No problem. Glad you got it resolved.

Reply

You must log in to post.

About this Topic