Support

Account

Home Forums Front-end Issues Custom taxonomy slug not ID (again, i know) Reply To: Custom taxonomy slug not ID (again, i know)

  • Now the field is a Term ID, and it works, showing the numeric ID of my taxonomy.
    And is a radio field.

    Meanwhile i’ve uploaded my work in progress in a live server, with no improvements…

    I’ve found this code and it seems to work!

    <?php   // Get terms for post
     $terms = get_the_terms( $post->ID , 'tecnica' );
     // Loop over each item since it's an array
     if ( $terms != null ){
     foreach( $terms as $term ) {
     // Print the name method from $term which is an OBJECT
     print $term->name ;
     // Get rid of the other data stored in the object, since it's not needed
     unset($term);
    } } ?>

    from here, where is also suggested to use wp_get_object_terms( $object_ids, $taxonomies, $args )

    I’ve tried on new and old posts, changing the category changes correctly in the front end.

    Can we marked this [resolved]?
    Thanks again!