Reputation: 2800
I added a custom post type to my wordpress theme. I related with category taxonomy, I can relate with the same categories as the posts. What I need is a custom category for my custom post type.
Eg: "book" for post type and book-category/fictional
I need it to be different than post categories. Is this possible?
Upvotes: 0
Views: 72
Reputation: 2626
Yes sir it is possible!
http://codex.wordpress.org/Taxonomies
In a nutshell:
function register_book_genre_taxonomy() {
register_taxonomy(
'book_genre',
'book',
array(
'label' => __( 'Genre' ),
'rewrite' => array( 'slug' => 'genre' )
)
);
}
add_action( 'init', 'register_book_genre_taxonomy' );
Upvotes: 1