Title: [Plugin: Custom Post Template] custom post types
Last modified: August 20, 2016

---

# [Plugin: Custom Post Template] custom post types

 *  [bphil00](https://wordpress.org/support/users/bphil00/)
 * (@bphil00)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/)
 * Hey, so support for custom post types isn’t working for me. The plugin is working
   on standard posts though.
 * I put this at the bottom on my functions.php file:
 *     ```
       /**
        * Hooks the WP cpt_post_types filter
        *
        * @param array $post_types An array of post type names that the templates be used by
        * @return array The array of post type names that the templates be used by
        **/
       function my_cpt_post_types( $post_types ) {
           $post_types[] = 'Items';
           return $post_types;
       }
   
       add_filter( 'cpt_post_types', 'my_cpt_post_types' );
       ```
   
 * I have one custom post type, named Items.
    Is there some other code I need to
   put somewhere in addition to this?
 * Also, in the Other Notes section on the plug-in’s page, it says “You can **ALSO**
   add this code to the functions.php file in your theme.” But it doesn’t say where
   it would be placed otherwise. Where does it go if you’re not putting it in functions.
   php?
    Sorry if this a dumb question, I’m new to this.
 * Thanks in advance, I’m looking forward to utilizing this plug-in!
 * [http://wordpress.org/extend/plugins/custom-post-template/](http://wordpress.org/extend/plugins/custom-post-template/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Simon Wheatley](https://wordpress.org/support/users/simonwheatley/)
 * (@simonwheatley)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322173)
 * Hi bphil00,
 * Can you post the code you’re using to register your custom post type, please?
 *  Thread Starter [bphil00](https://wordpress.org/support/users/bphil00/)
 * (@bphil00)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322291)
 * sure, here it is:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 *  Thread Starter [bphil00](https://wordpress.org/support/users/bphil00/)
 * (@bphil00)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322296)
 * damn it, moderator!
    I’m at work now, I’ll repost using pastebin when I get home
   this evening. Sorry about that.
 *  Plugin Author [Simon Wheatley](https://wordpress.org/support/users/simonwheatley/)
 * (@simonwheatley)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322303)
 * It’s OK. I think the problem might be where you have `register_post_type( 'Items',…`
   WordPress is transforming to `items` (note lowercase).
 * Accordingly, try changing your `$post_types[] = 'Items';` to `$post_types[] ='
   items';` (again, note lowercase).
 * Let me know how that is for you.
 *  Thread Starter [bphil00](https://wordpress.org/support/users/bphil00/)
 * (@bphil00)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322305)
 * Thank You!
    I’ll try it when I get home and update you.
 *  Thread Starter [bphil00](https://wordpress.org/support/users/bphil00/)
 * (@bphil00)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322327)
 * okay, I changed the uppercase ‘Items’ to ‘items’ and it worked! The meta box 
   now shows up in the custom post editor. Unfortunately it’s not applying the template
   to the post’s page when viewing it.
 * Here’s the code I used to register it:
    [http://pastebin.com/hvHDqFk1](http://pastebin.com/hvHDqFk1)
 * Any idea why it’s not applying the template?
 *  Thread Starter [bphil00](https://wordpress.org/support/users/bphil00/)
 * (@bphil00)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322332)
 * Actually, when I load that post it uses the 404 template.
    I’m at a loss here
   as to why this is happening.
 *  Thread Starter [bphil00](https://wordpress.org/support/users/bphil00/)
 * (@bphil00)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322397)
 * Well… damn, it’s a great idea for a plugin and definitely one that should be 
   part of the wordpress core.
    Let me know if you get it functional, in the meantime,
   I guess I’m back to the drawing board.
 * Anyone know of a plugin that adds custom templates to posts??

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘[Plugin: Custom Post Template] custom post types’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-post-template.svg)
 * [Custom Post Template](https://wordpress.org/plugins/custom-post-template/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-template/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-template/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-template/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-template/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-template/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [bphil00](https://wordpress.org/support/users/bphil00/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-custom-post-types/#post-2322397)
 * Status: not resolved