• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

WordPress Tips and Tricks

  • Home
  • WordPress Tutorials
  • Useful Links

Add Custom Taxonomy to WooCommerce

Home - WooCommerce - Add Custom Taxonomy to WooCommerce

August 19, 2020 by wptricks

Add a custom taxonomy to WooCommerce products.

// Register Custom Taxonomy
function ntd_custom_taxonomy_Item()  {

$labels = array(
    'name'                       => 'Brands',
    'singular_name'              => 'Brand',
    'menu_name'                  => 'Brands',
    'all_items'                  => 'All Brands',
    'parent_item'                => 'Parent Brand',
    'parent_item_colon'          => 'Parent Brand:',
    'new_item_name'              => 'New Brand Name',
    'add_new_item'               => 'Add New Brand',
    'edit_item'                  => 'Edit Brand',
    'update_item'                => 'Update Brand',
    'separate_items_with_commas' => 'Separate Brand with commas',
    'search_items'               => 'Search Brands',
    'add_or_remove_items'        => 'Add or remove Brands',
    'choose_from_most_used'      => 'Choose from the most used Brands',
);
$args = array(
    'labels'                     => $labels,
    'hierarchical'               => true,
    'public'                     => true,
    'show_ui'                    => true,
    'show_admin_column'          => true,
    'show_in_nav_menus'          => true,
    'show_tagcloud'              => true,
);
register_taxonomy( 'item', 'product', $args );

}

add_action( 'init', 'ntd_custom_taxonomy_item', 0 );
Category: WooCommerce, Code Snippets
Previous Post:Animated Icons
Next Post:1 Line Layouts

Sidebar

Recent Posts

  • Truncate Text with CSS
  • CSS { In Real Life }
  • Prevent Links in Gravity Forms Paragraph Text Field
  • Meta Description on Pages
  • Find Out Which Host a Website is On

Categories

  • Code Snippets
  • Design Resources
  • Fonts
  • SEO
  • Tutorials
  • Uncategorized
  • Useful Links
  • WooCommerce

A Few of Our Favorite Products


Copyright © 2023 · WordPress Tips and Tricks · All Rights Reserved

Back to top