Skip to content

Instantly share code, notes, and snippets.

@justinwhall
Created April 2, 2012 18:50
Show Gist options
  • Save justinwhall/2286280 to your computer and use it in GitHub Desktop.
Save justinwhall/2286280 to your computer and use it in GitHub Desktop.
PHP : WordPress | Custom Taxonomy
//Custom taxonomy
function build_taxonomies() {
// create a new taxonomy
register_taxonomy(
'Tax_name',
'For_post_ype',
array(
'label' => __( 'Tax_label' ),
'sort' => true,
'show_ui' => true,
'hierarchical' => true,
'args' => array( 'orderby' => 'term_order' ),
'rewrite' => array( 'slug' => 'slugname' )
)
);
}
add_action( 'init', 'build_taxonomies' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment