I have a problem here, I registered a custom post type and I named it ‘recipe’
then I created a custom taxonomy under the post type, I named it ‘recipe category’. Now I want to display the of categories under that custom taxonomy, but unfortunately I have no luck.
I tried this code
<?php
$taxonomy = 'recipecategory';
$tax_terms = get_terms($taxonomy);
?>
<ul>
<?php
foreach ($tax_terms as $tax_term) {
echo '<li>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></li>';
}
?>
</ul>
but it displays nothing, what’s wrong with my code? did I missed something.
Almost forgot to mention, I am using the plugin Custom Post Type UI