Home Forums General Issues Taxonomy term not displaying


Taxonomy term not displaying

  • Not sure what I’m doing wrong but I have a ACF Taxonomy field with Single Value (Select) and I’m trying to display the value in the front end but nothing is showing

    $term = get_field('temp_tax');
    if( $term ): ?>
    <h2><?php echo esc_html( $term->name ); ?></h2>
    <?php endif; ?>

    Any ideas or help would be very much appreciated.

  • Hey @daretothink,

    Is your return value set to Term Object or Term ID?


  • Very odd. Tried both Object and ID and neither seemed to work the other day. Just tried again now and things worked perfectly. Might have been one of those things where I’d coded something else incorrectly and that was having a knock on affect to that code. Anyway, all good now with that code. I used “Term Object” BTW to get it to display.

  • Ah well, I’m glad you sorted it @daretothink !

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Taxonomy term not displaying’ is closed to new replies.