CPT gives 404
-
Hello, I upgraded to 4.0 and my CPT now returns 404 error, I register my CPT like this:
function create_post_type() { $labels = array( 'name' => 'Staff', 'singular_name' => 'Staff' ); $args = array( 'labels' => $labels, 'description' => "Description", 'public' => true, 'exclude_from_search' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_nav_menus' => false, 'show_in_menu' => true, 'show_in_admin_bar' => true, 'menu_position' => 20, 'menu_icon' => null, 'capability_type' => 'post', 'hierarchical' => true, 'supports' => array('title','editor','thumbnail','custom-fields','page-attributes'), 'has_archive' => false, 'rewrite' => false, 'query_var' => true, 'can_export' => true ); register_post_type('my_staff', $args); } add_action('init', 'create_post_type');
If I change ‘hierarchical’ to false, everything works, but the thing is that I need ‘hierarchical’ set to true, which is currently giving me 404 error, if I try to view my post. Has anyone encountered this problem after 4.0? Is there a fix?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘CPT gives 404’ is closed to new replies.