admin管理员组文章数量:1130349
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.
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.
本文标签: I have made the custom post type but its single view is going to index
版权声明:本文标题:I have made the custom post type but its single view is going to index 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749139023a2321865.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论