This is my code to generate the custom post type.
add_action( 'init', 'feature_post_type' );
function feature_post_type() {
$labels = array(
'name' => 'Feature Posts',
'single_name' => 'Feature Post',
'add_new' => 'Add New',
'add_new_item' => 'Add New Feature Post',
'edit' => 'Edit',
'edit_item' => 'Edit Feature Post',
'new_item' => 'New Feature Post',
'view' => 'View',
'view_item' => 'View Feature Post',
'search_items' => 'Search Feature Posts',
'not_found' => 'No Features found',
'not_found_in_trash' => 'No Features found in Trash',
);
$args = array(
'labels' => $labels,
'public' => true,
'rewrite' => array('slug' => 'feature'),
'menu_postion' => 5,
'has_archive' => true,
'hierarchical' => true,
'taxonomies' => array('category', 'post_tag'),
'can_export' => true,
'supports' => array( 'title', 'author', 'editor', 'comments', 'thumbnail', 'custom-fields', 'excerpt')
);
register_post_type( 'feature_posts ', $args );
}
The admin screen for the post type though lists all the posts from the wordpress database, while it should only display the feature_posts entries. You can see a screenshot of what I mean here. None of those posts are actually Feature_Posts, yet are still appearing in the custom post type admin screen.
I've gone through the codex page for custom post types and there doesn't seem to be anything pertaining to my problem.
Am I missing something from my $args array that limits the kind of posts the admin screen will display?
pre_get_posts()somewhere in your code and it's altering the post query. Is that a possibility? - Ohgodwhy