2
votes

I have created a custom post type 'featured' using the following code, I have stripped this down to nearly no options, and tried added every option and label there is, also tried getting rid of and adding the flush.

add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'featured',
    array(
        'labels' => array(
            'name' => __( 'Featured', 'kickstart' ),
            'singular_name' => __( 'Featured Item', 'kickstart' )
        ),
        'public' => true,
        'has_archive' => true,          
        'supports' => array('title','editor','excerpt','thumbnail'),
        'rewrite' => array('slug' => 'featured'),
        'show_in_menu' => true,
        'publicly_queryable' => true,
        'show_ui'            => true,
        'query_var'          => true,
        'capability_type'    => 'post',
        'hierarchical'       => false,
        'menu_position'      => null,
    )
);
flush_rewrite_rules();
}   

Still it will not show up in the menu, but it shows up under the NEW menu to create a new one.

http://imgur.com/bBYQJvf (image showing that it displays under the NEW (post) up top, but not on the menu.)

I was able to get the Admin Menu Editor plugin, and add the link manually into the admin menu as a quick fix, but I would like to know what the actual problem was? Anyone have any insight?

2
You may benefit from using the CCTM (Custom content type manager) plugin. It makes adding post types and fields pretty easy. wordpress.org/plugins/custom-content-type-manager - Kai Qing
That same code works just fine on my install. - doublesharp
@KaiQing trying to not use any plugins, my client already bogged his site down with a lot of plugins. - Monolith Multimedia
@doublesharp works on other sites of mine too, was actually copied from another site of mine. The issue isnt of it 'working', is making it show up in the admin menu. Is there a limit maybe on how many items are in the admin menu? Or something another plugin could be doing to block me from having new items in the admin menu? - Monolith Multimedia
Could be one of your plugins, or maybe you have something that is already using the "featured" for the slug? - doublesharp

2 Answers

2
votes

click the "Screen Options" tab in the upper-right-hand corner of the screen, and ensure that "Posts" is enabled (checked) if you need post and also you can see the custom post type which you have created.

1
votes

I just had this issue and it was because of a plugin "hiding" the custom post type in the left-hand admin menu. It was actually a custom plugin I was working on, and I had set the menu position in add_menu_page to a number that took priority I suppose. It was position 26 in my case.

My solution was to change my plugin's position to a higher number in add_menu_page and then I was able to see my custom post. To see if a plugin is causing the issue, try disabling all plugins to see if it comes back. If so, then reenable plugins one at a time until you find the culprit.