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');
  • Have you created custom taxonomy for CPT? Commented Sep 5, 2013 at 14:46

1 Answer 1


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

  • 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
    Commented Sep 5, 2013 at 14:50
  • These are the WordPress hooks. Commented Sep 5, 2013 at 14:52
  • What's name of your CPT taxonomy? Commented Sep 5, 2013 at 14:53
  • I added it all to a pastebin file Here
    – Howdy_McGee
    Commented Sep 5, 2013 at 15:01
  • I have changed my code by referring your pastebin code. Test it now. Commented Sep 5, 2013 at 15:04

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.