0
votes

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?

1

1 Answers

1
votes

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' );