Custom Taxonomy
You can add unlimited custom taxonomy to any post type you want. Its very easy to manage. No coding skills required. Just follow the steps and you're good to go.
Go to WP Builder > Taxonomy
You'll need this:
- Select Post Type
- Taxonomy Name
- Taxonomy Hierarchy
Select the post type you want to add your custom taxonomy in it.
Type your custom taxonomy name. Make sure its unique and not already in used by Wordpress itself.
The third option is Taxonomy Hierarchy
That means if you want your taxonomy has a parent child relation then mark it true
.
For further details visit the wordpress codex documentation page: Register taxonomy
Display the custom taxonomy into your theme template:
We have created the book author
taxonomy.
Inside the post loop
<?php
// Inside the wordpress loop as mentioned in post type display in the post type generation section
$terms = get_the_terms( get_the_ID(), 'book_author' );
if ( $terms && ! is_wp_error( $terms ) ) :
$book_author_links = array();
foreach ( $terms as $term ) {
$book_author_links[] = $term->name;
}
$book_author = join( ", ", $book_author_links );
?>
<p class="book author">
Book Author: <span><?php echo $book_author; ?></span>
</p>
<?php endif; ?>