Tag Info

Hot answers tagged

2

Yes, totally possible. SCENARIO 1 If you need only one taxonomy, all you need to do is to get all the term ID's of all terms assigned to the taxonomy and then pass that array of term ID's to a tax_query (Requires PHP5.4+) $term_ids = get_terms( 'TAXONOMY_NAME', [ // Array of arguments, see get_terms() 'fields' => 'ids' // Get only ...


2

There is no tax_query parameter for the WP_User_Query class. Since you've tagged the question with user-meta I can only assume you store the ID (or even the term name itself?) of a particular shop-category term as a user meta entry. In this case you would need something like this: // The 'WP_User_Query' arguments array $args = array( 'role' ...


2

You are fetching all the terms of your taxonomy, Use this instead : $terms = wp_get_post_terms(get_the_ID(), 'city-type'); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { echo '<span>' . $term->name . '</span>'; } } Note : First argument to the function is id of the ...



Only top voted, non community-wiki answers of a minimum length are eligible