Title: Using the function within get_terms
Last modified: August 30, 2016

---

# Using the function within get_terms

 *  [amycarolyn](https://wordpress.org/support/users/amycarolyn/)
 * (@amycarolyn)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-the-function-within-get_terms/)
 * I successfully pulled the icon within a query, however I’m having trouble getting
   it to show up within get_terms.
 *     ```
       <?php $terms = get_terms('expertise-categories', 'hide_empty=0' ); ?>
       <?php foreach( $terms as $term ): ?>
       <?php $termID = $term->term_id; ?>
       <?php if (function_exists('the_icon')) {
       the_icon(array('size=large'), 'taxonomy', $termID, true);
       } ?> etc..
       ```
   
 * Do you see what I’m doing wrong?
 * Thank you.
 * [https://wordpress.org/plugins/simple-category-icons/](https://wordpress.org/plugins/simple-category-icons/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * (@basszje)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-the-function-within-get_terms/#post-6237093)
 * For the parameter ‘taxonomy’ you probably have to pass the taxonomy you are using?
 *  Thread Starter [amycarolyn](https://wordpress.org/support/users/amycarolyn/)
 * (@amycarolyn)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-the-function-within-get_terms/#post-6237194)
 * No, that doesn’t work. Do you know how to call the icon in a foreach with the
   terms? I have the term ID, then I should be able to display it with that right?
   Is there something wrong with the way I’m calling the icon using the term ID?
   I tested to make sure the term ID variable was working.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using the function within get_terms’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-category-icons.svg)
 * [Simple Category Icons](https://wordpress.org/plugins/simple-category-icons/)
 * [Support Threads](https://wordpress.org/support/plugin/simple-category-icons/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-category-icons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-category-icons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-category-icons/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [amycarolyn](https://wordpress.org/support/users/amycarolyn/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/using-the-function-within-get_terms/#post-6237194)
 * Status: not resolved