Home › Forums › Pro Support › Custom Fields › Reply To: Custom Fields
February 4, 2020 at 11:24 am
#13166
Participant
That code doesn’t work properly, Tom. I explain:
Within the “dormitorio” taxonomy I have the values 0, 1, 2, 3 and 4 (these are the room numbers). If an entry has only the value 3 marked, only that value should be shown but it does not do well because it shows all the values 0, 1, 2, 3 and 4. How can it be solved and how can include several taxonomies with diferents classes in this code?
$terms = get_terms( ( array('taxonomy' => 'dormitorio', 'hide_empty' => false,)));
if ( isset( $terms ) && '' !== $terms ) {
foreach( $terms as $term ) {
echo '<div class="tax dormitorio">';
echo $term->name;
echo '</div>';
}