Created
January 6, 2017 14:34
-
-
Save solid-pixel/bc4c4c9697a7c2246c5bf5310725e77f to your computer and use it in GitHub Desktop.
Register Taxonomy exclusive to a specific custom post type
This file contains hidden or 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
add_action( 'init', 'build_taxonomies', 0 ); | |
function build_taxonomies() { | |
register_taxonomy( | |
'course_type', //taxonomy slug | |
'course', // custom post type slug | |
array( | |
'hierarchical' => true, //shows as category, set false to show as tags | |
'label' => 'Course Type', //taxonomy label | |
'query_var' => true, | |
'rewrite' => true | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment