0
votes

Newbie here. I was following a video tutorial displaying custom taxonomies in WordPress. In the video tutorial it was showing how to edit the file single_product.php which is the custom taxonomy that was used in the video as an example, this file was in the directory wp-content/theme/current_theme. But as I check my installation directory I don't see it anywhere. I have research the WordPress codex and was mentioned that sometimes the custom post single.php file is not available for all themes. And that the single.php file should just be used and modified instead.

Can someone help me how to modify the single.php file to display the taxonomies on each custom post I have? or maybe point me to good reference? Any help is greatly appreciated. Thanks in advance! Cheers!

1

1 Answers

0
votes

A wordpress theme must have at least 2 files:

  • style.css
  • index.php

All other files are optional. To understand which file is for which purpose, you can read this article "Template Hierarchy" and look this graphic. It helped me a lot.

To get taxonomies of a post, you can use get_the_taxonomies().