We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Custom Fields Reply To: Custom Fields


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>';