Support

Account

Home Forums Front-end Issues Display the name of taxonomy

Helping

Display the name of taxonomy

  • Hello
    I have create a field type taxonomy
    I want to display the name of this category on front end
    with: <?php the_field(‘taxonomy’); ?>
    but it return a number ( Id ?) and not the name of the taxonomy
    What is the PHP code ?

    also i want to return the url of this taxonomy ? What is the PHP code ?

    Thanks !

  • Hi JF,
    You can try this one, it should works:

    <?php $term = get_field('taxonomy');
    if( $term ): 
    echo $term[0]->name;
    endif; ?>
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Display the name of taxonomy’ is closed to new replies.