Getting single value of taxonomy associated with post
-
I have custom post type and associated taxonomies, i want to return a value of taxonomy within loop, what is the best way to do this?
example. custom post type >> movies
taxonomy is >>>>> actorsnow within loop i want to output the name of actor for a particular movie,,,
i tried this
<?php $terms = wp_get_post_terms($post->ID, 'actors', array("fields" => "names")); print_r($terms);?>
this returns
Array ( [0] => name of actor )
can some one suggest a better query to get the single value from taxonomy or correct this one.
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Getting single value of taxonomy associated with post’ is closed to new replies.