You can use the get_term_by
function. This allows you to obtain a term (from a given taxonomy) by its slug or name (or id). The returned term object contains the term’s ID.
For example:
$term =get_term_by( 'name', 'December-12', 'Birthday');
$term_id = $term->term_id;
If ‘December-12’ is the slug, rather than the name, of the term, simply replace ‘name’ with ‘slug’.
Related Posts:
- wp_query get post custom taxonomy in search.php
- query variables for custom taxonomies
- Custom Query for Taxonomy
- WordPress Paginate $wpdb->get_results
- Custom Search Query
- Custom taxonomy: same terms, but for different years
- get_terms return errors
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- How to show only Standard Format post in my custom taxonomy page -wordpress 3.8.1
- Reproducing hierarchical list output from wp_list_categories(), using get_categories()
- Fast way to add countries as a custom taxonomy term?
- Retrieve and display data from custom db table in admin area?
- How to find if a post with custom_field == X exists?
- Custom search page and search by title, content and tag
- Modifying loop on a custom page, strange behaviour
- Is there a filter hook that I can use to change how taxonomy term names are displayed?
- How to Register and Display Widget for Custom taxonomy
- Show Custom Taxonomy Slug(s)?
- Custom Taxonomy Archive not displaying entries
- Exclude custom taxonomy tag from loop
- Hide custom field if empty
- Filter posts by custom taxonomy terms
- How I display post of the post type group by year of post?
- Function to remove archive sidebar for custom taxonomy?
- Load more posts with multiple queries
- Hi, I wanted to make custom search with multiple fields
- Automatically check parents (in a taxonomy) when child is selected
- How to add textarea field to taxonomy (tag)?
- How can I get the custom post type assigned to a current custom taxonomy for query?
- $wpdb->replace: WHERE?
- Order posts with a custom field but also without
- Save title as custom field on custom post type
- How to get every custom taxonomy names and urls?
- Get Custom Taxonomy Terms by Date
- Add content in between of foreach
- Custom Loop Query For Search Page
- Display specific Taxonomy Term from Custom Post Type
- Semi complicated custom taxonomy question
- Custom SELECT Query With Multiple Meta Values (Ordering Problem)
- Get wordpress taxonomy slug name(s) to use as div class
- How do I list custom taxonomy terms with the links?
- Query for specific custom field
- Display posts by combining multiple meta key
- Custom select query two tables by a meta key
- Custom Same Page Search
- Fatal error Call to a member function insert() on a non-object [closed]
- custom user meta query
- Recent activity query WordPress
- Echo the Last Child Taxonomy only (not parents)?
- WP Search Form Query: Add Author’s posts into search query
- How to show parent taxonomy using get_the_terms?
- wp_insert_post custom taxonomy multiple Category not added
- display text generated via custom get query string
- If Term Name Exists, Append a Unique ID to Slug
- Display all subterms of a custom taxonomy filtered by parent terms
- My list of terms of custom taxonomy displays 7 times
- Display Custom Taxonomy Name As A Shortcode
- Taxonomy template is not reading
- URL issue after setting up Custom Structure in Settings >> Permalinks
- How to assign a default/priority taxonomy to be shown in url in case two taxonomy items are selected
- Custom query pagination with php parameter as arg problem
- Post filter with multiple checkbox taxonomy terms
- How to automatically pull an information from a form field onto an other page?
- Query Posts to display all posts with category “custom field value”
- Combine Categories & Custom Taxonomy
- Custom dropdown search form that allows users to select option B based from Option 1
- issue with saving custom metaboxes fields
- Query 1 custom post type, each day, alphabetically
- Taxonomy template by post type
- How to loop through 1 CPT with 2 Taxonomies
- Multiple Taxonomies Using Custom SQL Query
- Custom terms in custom category taxonomy
- How to setup a taxonomy that can have only one post assigned to it?
- Search a meta field for a value in all posts
- Grouped custom taxonomy query
- Custom WordPress SQL Query 4 posts per custom taxonomy
- Special Query: Title, Terms, Content – %LIKE%
- Custom MySQL query to list post
- Custom Query Arguments
- Create advanced portal website with sections – taxonomy usage?
- Adding a third custom taxonomies
- Include plugin´s table in custom query
- User Query Multiple Orderby Clause
- Create a Custom menu item fetched by Product Categories and Sub Categories
- Multi-Site Plugin Activated (Not Network-Activated), What Happens?
- Add custom taxonomy under the category title
- Adding action to save_post, post needs to be saved twice for function to work
- 1 bit audio player
- Outputting posts from post id´s in variable
- How to get pages id in array in get_pages?
- Access post meta in future_to_publish function
- Javascript Solution Remove Specific Tag but leave the rest in a specific DIV
- woocommerce_checkout_fields modifying existing billing_phone label created new field
- How to host 2 subdomains as lookalike destinations under one master domain?
- Modify files without losing customization after updates
- Lightbox not showing image caption
- WordPress core jquery version file not loaded?
- How to Password Protect whole site except for some subdirectories
- Assign classes to Custom fields
- Prevent posts from being published if the ‘Uncategorized’-category or no category is selected