Home › Forums › General Issues › How to display a Taxonomy content instead of ID? › Reply To: How to display a Taxonomy content instead of ID?
Yes, unfortunately nothing is showing. I’m using a page builder and inserting a code block where I input:
<?php
$term = get_field('category_insect_family');
if( $term ): ?>
<h2><?php echo $term->name; ?></h2>
<p><?php echo $term->description; ?></p>
<?php endif; ?>
Result is blank with any option (ID or Object) for Custom Field = Family (insect_family).
If I change:
$term = the_field('insect_family');
I get the category ID value – if field is setup to return ID. When I change it to object this goes blank again.
Any hints?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.