Last active
September 27, 2019 10:41
-
-
Save mavinothkumar/2ea3a5b82b838d8167c252b359adf0ff to your computer and use it in GitHub Desktop.
Create a Taxonomy for Custom Post Event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a Taxonomy for Custom Post Event | |
* Paste this code in Theme function.php | |
*/ | |
add_action('init', 'create_event_taxonomy', 0); | |
if ( ! function_exists('create_event_taxonomy')) { | |
function create_event_taxonomy() | |
{ | |
register_taxonomy( | |
'event_category', | |
'event', | |
array( | |
'labels' => array( | |
'name' => 'Event Category', | |
'add_new_item' => 'Add New Event Category', | |
'new_item_name' => "New Event Category" | |
), | |
'show_ui' => true, | |
'show_tagcloud' => false, | |
'hierarchical' => true | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment