You can use get_term_by
to retrieve a term by its ID:
$term_id = 123;
$term = get_term_by( 'id', $term_id, 'location' );
if( $term ){
echo $term->name;
}
Related Posts:
- Get Terms by IDs with IDs order
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- How to List Events by Year and Month Using Advanced Custom Fields?
- Compare two numeric custom fields
- Advanced Custom Fields – Query Efficiency
- Search Terms – Querying on either description__like OR name__like in the same Term Query?
- Query set using tax_query with relation ‘OR’ modifies category object?
- can’t get query to order posts by acf datepicker
- Custom query to get terms from post ids
- Order posts by custom field DATE value
- wpdb->term_taxonomy count posts from both published and private posts?
- Post with certain term and without any term
- Order posts by date, but also give priority for a specific term
- Get the_field of Advanced Custom Fields in a custom query [closed]
- Advanced Custom Fields – Relationship post foreach query
- Order terms by count – missing terms
- Querying Advanced Custom Fields
- Exclude in get_pages() based on meta field
- Sort query_terms_list for post_tags alphabetically
- WordPress query: merge meta key (number) values and sort
- wp query multiple values > display a specific value first
- Advanced Custom Fields Query with Different Values of the Same Key
- No results for taxonomy archive page
- Multiple terms not working on taxonomy
- Modify a query using both a text field and a true/false AFC field
- How can I create a meta_query with an array as meta_field?
- Query multiple meta key values?
- Is there a way of increasing the speed of this query?
- How can I query all users who registered today?
- Reversing the order of posts AFTER the query is performed
- what are the numbers between curly brackets in search query
- How to get link and title of next and previous post on single page
- Get value in custom field with taxonomy [closed]
- Search custom post type by meta data
- Multipart/formatted MySQL query problem
- Remove [gallery] shortcode altogether
- query multiple taxonomy and show post count
- Categories and products in random order
- add_query_arg() XSS Vulnerability
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Pass array of taxonomy terms to wp_query
- Change searched term
- Query Posts By Post Publish Date, but sort by Custom Meta Key
- MySQL variable in query
- How to execute a SQL-query which contains multiple queries using $wpdb->query?
- Only show upcoming event or current events
- Why a URL with a query is always slower than that without a query?
- Maintaining Queries in URL
- How to orderby multiple meta fields with another meta query
- Query posts using meta_key
- Modify users.php query with multiple taxonomies
- MySql Query very slow
- wpdb query problem to access previous 3 days posts
- How to change the amount of posts previewed on a page?
- How to get events using multiple custom meta fields?
- Random Page Rewrite
- How to pull posts into two columns with different image sizes using $counter variable?
- Select column name dynamically mySQL Query
- WordPress Mysql query and Duplicate
- Combining two meta_values within one row with query
- How to get the term description in a taxonomy term archive query?
- Target a page with query
- List only parent attributes on woocommerce admin atrributes page
- Merge CPT Taxonomy and Post Taxonomy in $query->set
- Problem with revisions only returning four results
- How do I get specific readable results from this query and array results
- I want to get on those users their meta value are like “AGENT” .. but this query is not working
- Add rewrite rule for archive search
- How to create a filter and add query params to all links
- Get 2 meta values from meta key column
- WordPress add_query_arg from ajax and make url friendly
- My custom pagination not displaying
- Wpdb->last_query returns bad query
- WP search exclude last letter from string
- Are there any best practices for creating a Like/Favourite feature in WordPress using custom MySQL tables and without any plugins?
- Query reversed when I use “category__not_in”
- How to reduce the load / no of queries on MySql Database
- $query->set( ‘post_type’, ‘post’ ); not working
- How i make a custom sql query for Woocommerce
- Display result from custom post meta query
- Show certain number of post from tags
- Wpdb empty result only if language is Russian
- Include custom table in query
- How to fix this insert? Don’t work for me!
- Display Upload Author & Get Uploaded Post ID
- Display list of most recent grandchild (third tier) pages
- How can I display a number to represent the order of post?
- Related Posts by taxonomy using Advance Custom Fields Plugin
- Update vs Insert logic but the last key is always inserted?
- Sort order in get_posts [closed]
- Query unique author ids with published post of type job
- Wpdb generates too many queries
- Custom Query for searching through custom fields
- Query posts alphabetically within this function
- Conditional Tag Custom Querys?
- query posts only works on the first page
- Custom Query for wp_posts using wp_postmeta
- WP Query outputs three items within a div
- How to figure out correct wp_options to have autoload=’yes’
- Use value from meta key array for use in WP_Query