Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I created two custom taxonomies (Majors and Seminar Types) related my custom post type CEMB Seminar and the labels on the menu, instead of showing the labels I put in are showing "Post Tags".

See a screenshot here (I don't have enough reputation to post pics yet): https://picasaweb.google.com/112518288555484095597/WordPressIssues?authuser=0&authkey=Gv1sRgCNeKmKmS2J_ccQ&feat=directlink

Here's the code I used to create the custom taxonomies:

// Register the Majors taxonomy
register_taxonomy( 'cemb_seminar_major', array( 'cemb_seminar' ), $major_args );

// Register the Seminar Types taxonomy
register_taxonomy( 'cemb_seminar_type', array( 'cemb_seminar' ), $types_args );

// Set up the Majors arguments
$major_args = array( 
    'rewrite' => array(
        'slug' => 'major',
        'with_front' => 'false'
    ),
    'labels' => array(
        'name' => 'Majors',
        'singular_name' => 'Major'
    )       
);

// Set up the Types arguments
$types_args = array( 
    'rewrite' => array(
        'slug' => 'seminar-type',
        'with_front' => 'false'
    ),
    'labels' => array(
        'name' => 'Seminar Types',
        'singular_name' => 'Seminar Type'
    )
);

I thought maybe since I didn't include all the labels, it wasn't creating the labels correctly, so I later added:

'labels' => array(
            'name' => _x( 'Majors', 'taxonomy general name' ),
            'singular_name' => _x( 'Major', 'taxonomy singular name' ),
            'search_items' => __( 'Search Majors' ),
            'popular_items' => __( 'Popular Majors' ),
            'all_items' => __( 'All Majors' ),
            'edit_item' => __( 'Edit Major' ),
            'update_item' => __( 'Update Major' ),
            'add_new_item' => __( 'Add New Major' ),
            'new_item_name' => __( 'New Major' ),
            'separate_items_with_commas' => __( 'Separate majors with commas' ),
            'add_or_remove_items' => __( 'Add or remove majors' ),
            'choose_from_most_used' => __( 'Choose from the most popular majors' )
        )

and

'labels' => array(
            'name' => _x( 'Seminar Types', 'taxonomy general name' ),
            'singular_name' => _x( 'Seminar Type', 'taxonomy singular name' ),
            'search_items' => __( 'Search Seminar Types' ),
            'popular_items' => __( 'Popular Seminar Types' ),
            'all_items' => __( 'All Seminar Types' ),
            'edit_item' => __( 'Edit Seminar Type' ),
            'update_item' => __( 'Update Seminar Type' ),
            'add_new_item' => __( 'Add New Seminar Type' ),
            'new_item_name' => __( 'New Seminar Type' ),
            'separate_items_with_commas' => __( 'Separate seminar types with commas' ),
            'add_or_remove_items' => __( 'Add or remove seminar types' ),
            'choose_from_most_used' => __( 'Choose from the most popular seminar types' )
        )

But neither changed helped. I noticed my custom post type also didn't have all the labels customized, so I added the labels to that code and the menu changed to reflect the newly added labels, but the custom taxonomies won't do that. What did I do wrong and how do I fix it?

share|improve this question
    
Your args need to be defined before registering the taxonomies, that is most definately your issue if the args are being defined after - as in the above code. –  t31os Jul 15 '11 at 8:21
add comment

1 Answer 1

up vote 0 down vote accepted

Try changing 'labels' to an array arg, and passing that. Also, check for syntax:

$labels => array(
    'name' => _x( 'Seminar Types', 'taxonomy general name' ),
    'singular_name' => _x( 'Seminar Type', 'taxonomy singular name' ),
    'search_items' => __( 'Search Seminar Types' ),
    'popular_items' => __( 'Popular Seminar Types' ),
    'all_items' => __( 'All Seminar Types' ),
    'edit_item' => __( 'Edit Seminar Type' ),
    'update_item' => __( 'Update Seminar Type' ),
    'add_new_item' => __( 'Add New Seminar Type' ),
    'new_item_name' => __( 'New Seminar Type' ),
    'separate_items_with_commas' => __( 'Separate seminar types with commas' ),
    'add_or_remove_items' => __( 'Add or remove seminar types' ),
    'choose_from_most_used' => __( 'Choose from the most popular seminar types' )
);
// Set up the Types arguments
$types_args = array( 
    'rewrite' => array(
        'slug' => 'seminar-type',
        'with_front' => 'false'
    ),
    'labels' => $args
);
// Register the Seminar Types taxonomy
register_taxonomy( 'cemb_seminar_type', array( 'cemb_seminar' ), $types_args );
share|improve this answer
    
Thanks for that Chip. Actually, it appears that I had the register_taxonomy statement above the variables with all the labels in it. When I put the register_taxonomy statement below the variables, the labels now appear correctly. Thanks again for the help, you gave me the idea to look there. –  Slushman Jul 14 '11 at 19:37
1  
Ah, so it was syntax (sort of) after all. Note that, while hooks can be called before their callback functions, I don't think the same is generally true for variables - especially argument arrays, c.f. comment_form() - passed to other functions. –  Chip Bennett Jul 14 '11 at 19:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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