Title: Taxonomy anomaly
Last modified: August 19, 2016

---

# Taxonomy anomaly

 *  [scrollpost](https://wordpress.org/support/users/scrollpost/)
 * (@scrollpost)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/taxonomy-anomaly/)
 * I am making wordpress posts programmatically with multiple taxonomies.
    There
   is a mix of hierarchical and flat taxonomies.
 * For the hierarchical taxonomy I am using the taxonomy id via a “term_exists” 
   query.
    NO PROBLEM.
 * But along the way I converted one taxonomy from flat to hierarchical and forgot
   to switch from using the string of the term to the ID and it still worked.
    BEFORE
   I proceed, please note I have read in the codex that this is NOT recommended 
   and why, but I have no name conflicts.
 * The problem I am having is when I use “get_the_term_list” to retrieve that taxonomy
   to combine it with a current date and convert it to a hash tag for twitter.
 * First I explode the term list into an array.
    Then I loop though the array with
   a foreach. First I combine the foreach variable with the date. NO PROBLEM.
 * BUT in the next line using the same variable I use a substr to limit the term
   to 3 characters for the hash tag, BUT the result is the first three characters
   of an anchor. I tested this without the substr and indeed the variable contained
   an anchor.
 * I don’t understand why there is this anomaly.
 * I tested the term-date taxonomy to see if it works properly and it does.

The topic ‘Taxonomy anomaly’ is closed to new replies.

## Tags

 * [get_the_term_list](https://wordpress.org/support/topic-tag/get_the_term_list/)
 * [taxonomies](https://wordpress.org/support/topic-tag/taxonomies/)
 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 0 replies
 * 1 participant
 * Last reply from: [scrollpost](https://wordpress.org/support/users/scrollpost/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/taxonomy-anomaly/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
