Custom Post Type Archive Template Not Working
-
Here’s my code for the custom post type:
function create_post_type() { register_post_type( 'galactic_gallery', array( 'labels' => array( 'name' => __( 'Gallery' ), 'singular_name' => __( 'Gallery Post' ), ), 'rewrite' => array( 'slug' => 'gallery', 'with_front' => false ), 'public' => true, 'menu_position' => 4, 'has_archive' => true, 'hierarchical' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'comments' ), 'taxonomies' => array( 'post_tag', 'category'), ) ); flush_rewrite_rules( false ); } add_action( 'init', 'create_post_type' );
I have single post template called single-galactic_gallery.php and that works. I have a page called archive-galactic_gallery.php and my gallery posts, when I click on a tag or a category, are not going there. Any help would be appreciated. Thanks!
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Custom Post Type Archive Template Not Working’ is closed to new replies.