Support » Fixing WordPress » How do I create custom post type that uses a page template?

  • Hey all

    Is it possible to create a custom post type of “page” than assign a template for all pages of these custom types? I wasnt sure if I can put in “page” as the capability_type.

    my code so far

    $args = array(
                'label' => __('Product landing'),
                'singular_label' => __('product'),
                'public' => true,
                'show_ui' => true,
                'capability_type' => 'post',
                'hierarchical' => false,
                'rewrite' => true,
                'supports' => array('title', 'editor', 'revisions')
        );
    
        register_post_type( 'product' , $args );

Viewing 1 replies (of 1 total)
  • I think that if you set ‘hierarchical’ => true, you will get what you want. The value of false creates a new type that acts like a post.

Viewing 1 replies (of 1 total)
  • The topic ‘How do I create custom post type that uses a page template?’ is closed to new replies.