• Resolved kthorjensen

    (@kthorjensen)


    I have three custom taxonomies registered and values attached to users in the backend.

    I’m trying to output those values on user profile pages with no results. Here’s my code with a few debugging things in them

    
    $taxonomies = get_object_taxonomies(get_the_ID(), 'objects');
    		echo count($taxonomies);
    $firm_terms = wp_get_object_terms( get_the_ID(), 'levelofexperience' );
                  if ( ! empty( $firm_terms ) ) {
          if ( ! is_wp_error( $firm_terms ) ) {
                  foreach( $firm_terms as $term ) {
                      echo $term->slug;
                  }
          }
      }else{
    				  echo "empty";
    			  }

    The count() gives 0 – empty array for taxonomies attached to the ID, and the check for empty on one specific tax returns empty. What am I missing here?

    • This topic was modified 6 years, 5 months ago by kthorjensen.
Viewing 1 replies (of 1 total)
  • Thread Starter kthorjensen

    (@kthorjensen)

    Belay that, I figured it out – you can’t use get_the_ID() on author pages, have to use get_the_author_meta(‘ID’) instead. Peace be with you.

Viewing 1 replies (of 1 total)
  • The topic ‘Taxonomy values not outputting’ is closed to new replies.