Skip to content

Instantly share code, notes, and snippets.

@ale7714
Created October 28, 2015 05:52
Show Gist options
  • Select an option

  • Save ale7714/fd4abe3a6ea8f92447c4 to your computer and use it in GitHub Desktop.

Select an option

Save ale7714/fd4abe3a6ea8f92447c4 to your computer and use it in GitHub Desktop.
Add taxonomie to WP
<?php
// Doc: https://codex.wordpress.org/Function_Reference/register_taxonomy
register_taxonomy('portfolio_tag','portfolio',array(
'hierarchical' => false,
'labels' => array(
'name' => _x( 'Tags', 'taxonomy general name' ),
'singular_name' => _x( 'Tag', 'taxonomy singular name' ),
'search_items' => __( 'Search Tags' ),
'popular_items' => __( 'Popular Tags'),
'all_items' => __( 'All Tags'),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit Tag'),
'update_item' => __( 'Update Tag'),
'add_new_item' => __( 'Add New Tag'),
'new_item_name' => __( 'New Tag Name'),
'separate_items_with_commas' => __( 'Separate Tag with commas'),
'add_or_remove_items' => __( 'Add or remove Tag'),
'choose_from_most_used' => __( 'Choose from the most used Tag')
),
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => false,
'show_tagcloud' => true
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment