Support

Account

Home Forums Front-end Issues Get Custom Taxonomy Field Value Reply To: Get Custom Taxonomy Field Value

  • I think my problem is similar to what’s been going on here, but I’m still coming up blank.

    I have a taxonomy field (checkbox, so multiple items can be chosen) inside a custom post type. So far so good. My query displays the selected taxonomies.

    But within those custom taxonomy terms I’ve added a FontAwesome field, so each term has an icon associated with it.

    What I’m trying to do is display all icons of terms selected within the custom post.

    Here’s my code so far (like I said, the term name itself is displaying just fine, but I want the icon associated with that term to be displaying):

    <?php $terms = get_field('tech_choices');
    $cat_icon = get_field('creative_icon', $queried_object); ?>
    <span>
    	<?php if( $terms ): ?>
    	<ul>
    		<?php foreach( $terms as $term ): ?>
    		<li><a href="<?php echo get_term_link( $term ); ?>"><?php echo $term->name; ?></a></li>
    		<?php $icon = get_field('creative_icon', $term->taxonomy . '_' . $term->term_id); echo $icon; ?>
    		<?php endforeach; ?>
    	</ul>
    	<?php endif; ?>
    </span>