Support

Account

Home Forums General Issues Taxonomy term not displaying

Solved

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

    <?php 
    $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?

    Dan

  • 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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.