Skip to content

Instantly share code, notes, and snippets.

@themepaint
Created August 6, 2015 07:45
Show Gist options
  • Save themepaint/6fe1402f59ef0f51fb2d to your computer and use it in GitHub Desktop.
Save themepaint/6fe1402f59ef0f51fb2d to your computer and use it in GitHub Desktop.
Custom Taxonomies in Custom Post
function team_taxonomies() {
$args = array(
'hierarchical' => true,
'labels' => array(
'name' => 'Team Members Type',
'singular_name' => 'Member Type',
'search_items' => __( 'Search Member' ),
'all_items' => __( 'All Member' ),
'parent_item' => __( 'Parent Member' ),
'parent_item_colon' => __( 'Parent Member:' ),
'edit_item' => __( 'Edit Member' ),
'update_item' => __( 'Update Member' ),
'add_new_item' => __( 'Add New Member' ),
'new_item_name' => __( 'New Genre Member' ),
'menu_name' => __( 'Members Type' ),
),
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'team-member' ),
);
// use by ('team-member'=>'php') and post type = (tp_team)
register_taxonomy( 'team-member', array( 'tp_team' ), $args );
}
add_action('init','team_taxonomies');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment