Get taxonomy name for the current post


I am trying to get the name for a custom taxonomy assigned to the current post and in my template I have:

   $countries = get_terms( 'country', array('hide_empty' => false,));
      $fcountry = $countries[0]->slug;

However this returns the first item in the $countries array, instead of the term that is assigned to the current post.

JoaMika 2 months 0 Answers 10 views 0

Leave an answer