Here's my code:
function create_posttype() {
register_post_type( 'movies',
// CPT Options
array( 'public' => true,
'labels' => array(
'name' => __( 'Movies' ),
'singular_name' => __( 'Movie' )
),
'has_archive' => true,
'rewrite' => array('slug' => 'movies'),
)
);
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );
I have also created the archive-movies.php
and single-movies.php
, but when I open the detail page of a post, it's going to index.php and showing the blogs list.