Support

Account

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?