I have a plugin that creates custom taxonomy categories for showing portfolio. On hovering Edit categories on admin panel, i see link like :
localhost/site/wp-admin/edit-tags.php?action=edit&taxonomy=mg_item_categories&tag_id=13&post_type=mg_items
What i want to do is add some CSS (a ribbon image), if product displays from a specific category. For example if products from category ‘new’ are displayed, it all shows “New Ribbon Image” So i am confused how can i target taxonomy? Any idea from the above link?
Should i use is_post_type
, is_taxonomy
or anything else that can help targetting taxonomy ID 13.
Here is the function that makes this taxonomy :
function register_cpt_mg_item() {
$labels = array(
'name' => _x( 'Item Categories', 'mg_item_categories' ),
'singular_name' => _x( 'Item Category', 'mg_item_categories' ),
'search_items' => _x( 'Search Item Categories', 'mg_item_categories' ),
'popular_items' => NULL,
'all_items' => _x( 'All Item Categories', 'mg_item_categories' ),
'parent_item' => _x( 'Parent Item Category', 'mg_item_categories' ),
'parent_item_colon' => _x( 'Parent Item Category:', 'mg_item_categories' ),
'edit_item' => _x( 'Edit Item Category', 'mg_item_categories' ),
'update_item' => _x( 'Update Item Category', 'mg_item_categories' ),
'add_new_item' => _x( 'Add New Item Category', 'mg_item_categories' ),
'new_item_name' => _x( 'New Item Category', 'mg_item_categories' ),
'separate_items_with_commas' => _x( 'Separate item categories with commas', 'mg_item_categories' ),
'add_or_remove_items' => _x( 'Add or remove Item Categories', 'mg_item_categories' ),
'choose_from_most_used' => _x( 'Choose from most used Item Categories', 'mg_item_categories' ),
'menu_name' => _x( 'Item Categories', 'mg_item_categories' ),
);
register_taxonomy( 'mg_item_categories', array('mg_items'), $args );
}
using this code get your '13' category taxonomy post :