WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm able to add an extra field to my categories (A Color picker actually, to color code categories - pretty cool stuff if anybody is interested) but the extra field ONLY shows up under Posts. I have a CPT with its own category page and it doesn't show up there. Is there a way to only have the extra field show up under my CPT categories page? Do I need to hook into something different?

Here's what I'm doing now:

/** Add New Field To Category **/
function extra_category_fields( $tag ) {
    $t_id = $tag->term_id;
    $cat_meta = get_option( "category_$t_id" );
<tr class="form-field">
    <th scope="row" valign="top"><label for="meta-color"><?php _e('Category Name Background Color'); ?></label></th>
        <div id="colorpicker">
            <input type="text" name="cat_meta[catBG]" class="colorpicker" size="3" style="width:20%;" value="<?php echo (isset($cat_meta['catBG'])) ? $cat_meta['catBG'] : '#fff'; ?>" />
            <br />
        <span class="description"><?php _e(''); ?></span>
            <br />
add_action ( 'category_add_form_fields', 'extra_category_fields');
share|improve this question
Have you created custom taxonomy for CPT? – Vinod Dalvi Sep 5 '13 at 14:46
up vote 1 down vote accepted

You can add the following hooks in your code to add it to event-category custom taxonomy.

share|improve this answer
I've seen this method before, like with managing post columns and such, does this work with most hooks? On that note, it doesn't seem to work - it removed them from Posts Categories but doesn't add them to my CPT Categories. Here's a pastebin with my CPT, Taxonomy, and Categories Fields - it seems to be spelled correctly. – Howdy_McGee Sep 5 '13 at 14:50
These are the WordPress hooks. – Vinod Dalvi Sep 5 '13 at 14:52
What's name of your CPT taxonomy? – Vinod Dalvi Sep 5 '13 at 14:53
I added it all to a pastebin file Here – Howdy_McGee Sep 5 '13 at 15:01
I have changed my code by referring your pastebin code. Test it now. – Vinod Dalvi Sep 5 '13 at 15:04

Your Answer


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.