Use case:
I have a custom post type of ‘show’ for a music venue. In the sidebar we want to display any related ‘show’ to the current one on single-show.php. They will be related by a custom taxonomy of ‘genre’. I figured I could dump the custom taxonomy slugs for a post (might be more than one) into a variable then pass that variable into a custom query for the sidebar post.
Using get_the_term_list() works if there is a single taxonomy but if there are multiple it breaks (of course).
Any thoughts on how to get an array of the custom taxonomy slugs for a give post into a variable?
You can do something like the following: