How to add a style to taxonomy edit page

You can do it like this:

add_action ('admin_enqueue_scripts', 'wpse_style_tax') ;

function
wpse_style_tax ()
{
    // these 3 globals are set during execution of {edit-tags,term}.php
    global $pagenow, $typenow, $taxnow ;

    if (!in_array ($pagenow, array ('edit-tags.php', 'term.php')) {
        return ;
        }
    if ('news' != $typenow) {
        return ;
        }
    if ('news-category' != $taxnow) {
        return ;
        }

    wp_enqueue_style ('wpse_my_handle', 'path_to_css_file', ...) ;

    return ;
}

Leave a Comment