I just updated to WordPress 3.7 this morning, and I started getting 404 errors on one of my custom post types. I am implementing multiple CPT's through one plugin. All other CPT's are wotking fine except one.
The code for the same is below:
// Register Author Post Type
function custom_post_author() {
$labels = array(
'name' => 'Authors',
'singular_name' => 'Author',
'add_new' => 'Add New',
'add_new_item' => 'Add New Author',
'edit_item' => 'Edit Author',
'new_item' => 'New Author',
'all_items' => 'All Authors',
'view_item' => 'View Author',
'search_items' => 'Search Authors',
'not_found' => 'No authors found',
'not_found_in_trash' => 'No authors found in Trash',
'parent_item_colon' => '',
'menu_name' => 'Authors'
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'authors' ),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'menu_icon' => plugins_url( 'images/authors.png', dirname( __FILE__ )),
'supports' => array( 'title', 'thumbnail', 'comments')
);
register_post_type( 'author', $args );
}
add_action( 'init', 'custom_post_author' );
The CPT is visible in the backend, but when I view any post on the frontend it gives a 404. Any suggestions on how to solve it?