[Resolved] How To Extract A Single Value from wp_get_post_terms
I want to display the term attached to a post in certain taxonomy.
I can get the taxonomy information for a post using
$sectiondata = wp_get_post_terms($post->ID, 'chapters', array("fields" => "all"));
I can display the array of values returned.
However, how do I echo the value for the ‘name’ of the term to the page?
I thought this should be something like:
But that returns nothing so I obviously don’t understand how to extract this value. I’ve searched around for examples and don’t see anything that explains how to display the value on the page, or perhaps better stated how to extract the value from the array. I’ve tried using the plain php approach of
But that doesn’t return anything either.
Where can I find an explanation of how to extract the value from the array.
- The topic ‘[Resolved] How To Extract A Single Value from wp_get_post_terms’ is closed to new replies.