Trying to get post tags with wordpress API - api call is /wp-json/wp/v2/posts
ourHTMLString += '<i class="fa fa-tags">"' + postsData[i].tags + '"</i>';
It is returning these values
"tags": [
766,
19,
578
],
I need the tag name and href to this, not sure how to get this. I have tried postsData[i].wp:term[i].tag.name - cannot find a solution. Any help? thanks
I think you need to do another request to get this and use include to list only theses tags. eg: /wp-json/wp/v2/tags?include=766,19,578
https://developer.wordpress.org/rest-api/reference/tags/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With