/ Published in: PHP
Use this to get the name of the custom taxonomy. Note that this only returns the name of the first selected item, but since this returns an array, use a foreach loop to find all names.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// get name of manufacturer of this post // replace 'manufacturer' with the id name of your custom taxomony $manufacturer = wp_get_post_terms($post->ID, 'manufacturer'); $manufacturer_name = $manufacturer[0]->name; // use this to display the name echo $manufacturer_name;
URL: www.centerdrive.ca