Custom Post Type UI
[resolved] Question: Do Custom Post Types Require Special Themes? (3 posts)

  1. starapple
    Posted 2 years ago #

    Hi there,

    Just a quick question as in the heading: do custom post types need a special theme to display their labels and content? That is, do I need to customize my theme to display whatever I create using Custom Post Type UI?

    Can a theme be made to be automatically aware of a custom post type?



  2. Michael Beckwith
    Plugin Author

    Posted 2 years ago #

    By default, each theme will, or at least should, be able to display CPT archives/single posts. You should be able to see the archive at http://www.domain.com/CPT-SLUG/ where "CPT-SLUG" is the slug you chose. Unless you tailor your theme to have custom templates for the CPT, it'll fall back to archives.php to display the archive. If you don't have a template for that, it falls back to index.php. Same thing with single posts, single.php and then index.php


    If you need to display them in custom locations or do custom things with them, then you'll need to use the WP_Query class to query for the posts in the post type, or if you're going a bit advanced, use the pre_get_posts hook to add them to already existing loops.



    Hope that answers your questions, but feel free to ask more, I'll get to them when I can.

  3. starapple
    Posted 2 years ago #

    Thanks Michael. I don't think for the time being I need to do anything but have a post category that mimics (is parallel to) the standard blog post in various categories.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Type UI
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic