Custom Post Template
Filter Templates for Posts and Custom Post Types (3 posts)

  1. jeffski
    Posted 4 years ago #

    I have a site using normal Posts and also set up my own Custom Post Types. I want to use different templates for normal Posts from what I use for Custom Posts.

    I added the function my_cpt_post_types(), as outlined in the Other Notes section, to get the template drop down to show on the Custom Post Page editor but is there a way to not show those templates on the normal Posts page editor?


  2. jeffski
    Posted 4 years ago #

    Figured this out, in case anyone is interested:

    - Use array_shift() to remove the first item from the array which is 'post' and is added by default.

    - So your code would look more like:

    function my_cpt_post_types( $post_types ) {
        $post_types[] = 'movie';
        $post_types[] = 'actor';
        return $post_types;
    add_filter( 'cpt_post_types', 'my_cpt_post_types' );
  3. jdawkinsatl
    Posted 4 years ago #

    This was very helpful! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Template
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic