Get Terms Not Consistent
-
Getting terms from some users inexplicably do not show up. I cannot figure out why. I am using the get terms samples below and while this works for the majority of my users I have user accounts with terms assign to them that have absolutely nothing show up. I have even changed $user->ID to the users actual id number and still nothing. I have gone in the database and have confirmed the terms are being recorded and the relationships between the object_id and the term_taxonomy_id exist in the term relationships. In two specific cases my object_id is 8 and 34. I can take the below script, paste it on any page, replace $user->ID with 34 and zero terms are returned. I’d really love some feedback as I am truly perplexed.
echo get_the_term_list( $user->ID, 'service', '<p><span class="label">Services:</span><span class="data">', ', ', '</span></p>' );
or$terms = get_the_terms( $user->ID, 'service' ); if( ! empty( $terms ) ) : foreach( $terms as $term ) : ?> <div class="<?php echo $term->slug; ?>"><?php echo $term->description; ?></div <?php endforeach; endif;
- The topic ‘Get Terms Not Consistent’ is closed to new replies.