3

I have created a custom taxonomy as described on the Codex. I have "public" set to true, which show_in_nav_menus is supposed to inherit from, and have also explicitly added the show_in_nav_menus variable and set it to true. However, it only shows up for the user with the username "Admin". None of the other users can see it under Appearance > Menus, even ones marked as being an "Administrator".

Here's my exact code:

function create_con_casino_reviews() {
    register_post_type( 'con_casino_reviews',
        array(
            'labels' => array(
                'name' => __( 'Casino Reviews' , 'continuum'),
                'singular_name' => __( 'Casino Review' , 'continuum'),
                'add_new' => __('Add new review', 'continuum'),
                'edit_item' => __('Edit review', 'continuum'),
                'new_item' => __('New review', 'continuum'),
                'view_item' => __('View review', 'continuum'),
                'search_items' => __('Search reviews', 'continuum'),
                'not_found' => __('No reviews found', 'continuum'),
                'not_found_in_trash' => __('No reviews found in Trash', 'continuum')
            ),
            'public' => true,
            'menu_position' => 25,
            'menu_icon' => get_stylesheet_directory_uri() . '/images/review-casino.png',
            'rewrite' => array('slug' => 'casino-review'),
            'supports' => array('title','editor','author','thumbnail','excerpt','trackbacks','custom-fields','comments','revisions'),
            'taxonomies' => array('category', 'post_tag'),
            'show_in_nav_menus' => true
        )
    );
}
add_action( 'init', 'create_con_casino_reviews' );

If I change:

register_post_type( 'con_casino_reviews',

to be:

register_post_type( 'con_casino_reviewss',

It works just fine.

2 Answers 2

3

Can you see it when you open the 'Screen Options' menu on the top right of the admin next to the 'Help' button? And with another user name?

Am a bit confused because your code doesnt show any register_post_type() function. Also, do you want to create a custom post type or a custom taxonomy?

Try with this basic code to create a custom post type, to see if it works for you:

/* books custom post type */
add_action( 'init', 'create_books' );
function create_books() {
    register_post_type( 'cpt-books',
        array(
            'labels' => array(
                'name' => __( 'Books' ),
                'singular_name' => __( 'Book' )
                ),
            'public' => true,
            'show_ui' => true,
            'publicly_queryable' => true,
            'exclude_from_search' => false,
            'menu_position' => 4,
            'query_var' => true,
            'supports' => array( 'title', 'editor' )

        )
    );
}
7
  • I fixed my code, when I was editing it for this post I accidentally deleted the "register_post_type(" function call. Sorry...
    – cmcculloh
    Commented Jun 10, 2011 at 1:16
  • So it's all fine now?
    – kevin
    Commented Jun 10, 2011 at 15:03
  • No, sorry, I meant I fixed the code in my question. It still doesn't work, but, YOUR code DOES work. So I'm trying to figure out what the difference between your code and my code is now.... thanks!
    – cmcculloh
    Commented Jun 10, 2011 at 16:37
  • OK, I updated my question with the exact code that does not work. When I change the text 'con_casino_reviews' to something else (like, 'con_casino_reviewsssss') it works fine. WHY???
    – cmcculloh
    Commented Jun 10, 2011 at 16:51
  • 1
    Might be a conflict with something already possessing this name because i tested your code without any modification on a test wp installation and it works fine, the custom post type 'Casino reviews' shows up in the admin.
    – kevin
    Commented Jun 10, 2011 at 19:06
2

Make sure you click "Screen Options" and check the checkbox for each menu you want to be able to select. For each user.

-_-

1
  • Oh man, you saved my day
    – Fred K
    Commented Jan 13, 2017 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.