ThemeShaper Forums » Thematic


Correct way to set up custom post type archive for child theme?

(5 posts)
  • Started 9 years ago by discofuel
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. discofuel

    Can somebody please point me in the right direction on how to set up a custom post type archive page on a child theme of Thematic, and query for the custom post type.

    e.g. archive-customposttype.php


    Posted 9 years ago #
  2. If it were me, I would modify this plugin by Devin Price,

    It is currently set up for the cpt of "portfolio", but could easily be modified to what you need. The benefit is if you do the cpt as a plugin, you can retain some of the information from theme to theme vs. building into the functions php, which you could do to.

    Also he has a cpt resource list which I know I have used a bunch of times, good info,

    Posted 9 years ago #
  3. wp does custom post type archives by default if you set archive to true when you register the post type:

    has_archive => true

    the slug defaults to the post type name so if you registered "portfolio" your archive would be at

    you don't need a custom query at all.

    thematic will display this using its archive.php template (or failing that b/c i really can't remember if it has one right now.. index.php). you can override that by dropping an archive-portfolio.php into your child theme.

    Posted 9 years ago #
  4. discofuel

    Thanks. And when creating a new page to display this archive, what's the best way to link to this archive from the nav menu, without having to create a custom template page?

    Posted 9 years ago #
  5. unfortunately i don't think you can add the archive in the WP menu (even if you set the post type to allow it to be shown in the menus). you'll need a custom link i think... and point it to the archive's URL. something i hope they fix for post type and tax archives in one of the next releases

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.