{"id":9587670,"date":"2017-10-14T19:12:16","date_gmt":"2017-10-14T19:12:16","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/regarding-shortcode\/"},"modified":"2017-10-14T19:43:54","modified_gmt":"2017-10-14T19:43:54","slug":"regarding-shortcode","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/regarding-shortcode\/","title":{"rendered":"Display taxonomy values"},"content":{"rendered":"<p>Hello, <\/p>\n<p>Could you please help me with php code to display custom taxonomy values.<br \/>\n I mean like there is a custom taxonomy by name &#8220;localstore&#8221;, values are BLUE and RED. Is there a php code that display these values. I tried this code, it shows but with errors. I use it in woocommerce product description.<\/p>\n<pre><code>&lt;?php\n\n$terms = get_the_terms( $post-&gt;ID, &#039;localstore&#039; );\nif ($terms) {\n    foreach($terms as $term) {\n      echo $term-&gt;name;\n    } \n}\n\n?&gt;<\/code><\/pre>\n<p>Thank you.<\/p>\n","protected":false},"template":"","class_list":["post-9587670","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9587670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9587670\/revisions"}],"predecessor-version":[{"id":9587721,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9587670\/revisions\/9587721"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9587670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}