Title: has_tag Function
Last modified: November 13, 2018

---

# has_tag Function

 *  [kedyao](https://wordpress.org/support/users/kedyao/)
 * (@kedyao)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/has_tag-function/)
 * After create-custom-taxonomies.
    If I use has_tag, I can’t call the new taxonomies.
   Can you tell me how I should use it?
 * e.g
    <? Php. If (has_tag (array (‘OL’) {echo “<div class=’hdinfo’>oline</div>”;}.
   Else {echo “;}. ? >

Viewing 1 replies (of 1 total)

 *  Anonymous User 14808221
 * (@anonymized-14808221)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/has_tag-function/#post-10878449)
 * This is how you need to use the WordPress Core function “has_tag”:
    `has_tag(
   string|int|array $tag = '', int|object $post = null )`
 * I do not see this applied in your code example, however, I can also not assist
   here the usage of WordPress Core code and API.
 * To display terms – created with Types – you can follow this great document on
   it:
    [https://toolset.com/documentation/customizing-sites-using-php/creating-taxonomy-term-archives/](https://toolset.com/documentation/customizing-sites-using-php/creating-taxonomy-term-archives/)
 * For example, to display a list of terms to which a post belongs, you need to 
   use the `get_the_term_list()` WordPress function. The following code outputs 
   terms belonging to a “Spoken languages” taxonomy, attached to the post:
    `echo
   get_the_term_list( $post->ID, 'spoken-language', '<p><strong>Spoken languages:
   </strong>', ', ', '</p>');`
 * It’s as well shown in the example templates (which the document mentions) in 
   the Types Plugin.
 * Please do not forget that Types, as it’s here, will [not exist anymore starting end of this year](https://toolset.com/2017/11/types-plugin-is-moving-to-be-a-part-of-the-complete-toolset-package/).

Viewing 1 replies (of 1 total)

The topic ‘has_tag Function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: Anonymous User 14808221
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/has_tag-function/#post-10878449)
 * Status: not resolved