// ON your wp-content/themes/theme_name ADD:
archive-{post-type-name}.php
// Example: archive-musicians.php
// Inside the file you should copy the archive.php or category.php
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Our custom post type function
function create_posttype() {
register_post_type( 'movies',
// CPT Options
array(
'labels' => array(
'name' => __( 'Movies' ),
'singular_name' => __( 'Movie' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'movies'),
'show_in_rest' => true,
)
);
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );