• 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://ww.wp.xz.cn/plugins/simple-category-icons/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bas Schuiling

    (@basszje)

    For the parameter ‘taxonomy’ you probably have to pass the taxonomy you are using?

    Thread Starter amycarolyn

    (@amycarolyn)

    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.