0
How do I display the category registered in a post type in Wordpress?
I’m using the Odin Framework, I created a post type
called products and would like to display the category next to the post.
Ex: Posted on July 6, 2017 in the category Refrigerators.
In blog posts, to display the categories the following code is used:
<?php echo __( 'Posted in:', 'odin' ) . ' ' . get_the_category_list(); ?>
I found a possible solution, but now it is displaying categories that the product does not belong. Ex: Ex: I have two products, refrigerator and stove, the refrigerator category has several subcategories, so mark all of them and the television category has only one. When I access the television product, it lists the category of refrigerators as well, why does this happen? Category: Refrigerator, small, television... Code used: http://pastebin.com/8e4d7Bn8
– Leonardo