Yep, I have been searching all over, and seems the only reason this should be happening is because it is not checked in the Screen Options menu in WordPress. My problem is, the custom post type is not showing in Screen Options so I was wondering if someone could have a look at my code and see if I’m doing some thing wrong.
function my_custom_post_maryland() {
$labels = array(
'name' => _x( 'Maryland', 'post type general name' ),
'singular_name' => _x( 'Maryland', 'post type singular name' ),
'add_new' => _x( 'Add New', 'Maryland page' ),
'add_new_item' => __( 'Add New Maryland Page' ),
'edit_item' => __( 'Edit Page' ),
'new_item' => __( 'New Page' ),
'all_items' => __( 'All Pages' ),
'view_item' => __( 'View Page' ),
'search_items' => __( 'Search Maryland Pages' ),
'not_found' => __( 'No Maryland pages found' ),
'not_found_in_trash' => __( 'No Maryland pages found in the Trash' ),
'parent_item_colon' => __( 'Parent Page' ),
'parent_item_colon' => '',
'menu_name' => 'Maryland'
);
$args = array(
'labels' => $labels,
'description' => 'Holds our Maryland pages specific data',
'public' => true,
'menu_position' => 5,
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
'show_ui' => true,
'has_archive' => true,
'show_in_nav_menus' => true
);
register_post_type( 'maryland', $args );
}
add_action( 'init', 'my_custom_post_maryland' );
You still need to add it to the menu using
and
and
After that you also need to add a new template file for single posts as well as archive posts, etc, so you can actually view them. The wordpress codex for ‘theme templates’ should help you there, as it’s quite easy.
Here’s a working example.
functions.php
You also need to register the menu in your functions.php in theme: