// We get a list taxonomies on the search box
function get_tax_by_search($search_text){
$args = array(
'taxonomy' => array( 'my_tax' ), // taxonomy name
'orderby' => 'id',
'order' => 'ASC',
'hide_empty' => true,
'fields' => 'all',
'name__like' => $search_text
);
$terms = get_terms( $args );
$count = count($terms);
if($count > 0){
echo "<ul>";
foreach ($terms as $term) {
echo "<li><a href="".get_term_link( $term )."">".$term->name."</a></li>";
}
echo "</ul>";
}
}
// sample
get_tax_by_search('Foo');
Related Posts:
- How do I search inside specific taxonomies in WordPress
- WP_Query Not Recognizing Taxonomy Parameter in Custom Search
- WP Query Args – Title or Taxonomy Value
- Search Query for multiple categories using ‘OR’ but having certain categories be ‘AND’
- Loop posts based on permalink term
- How to show terms from another taxonomy
- Search format not matching taxonomy query
- Can I force WP_Query to return no results?
- Post_count only shows the number of results per page
- WP Query where title begins with a specific letter
- WP query taxonomy input differs to output?
- Order Search Results Page by meta_value If no Value Return Remaining Results
- How to display post from current Taxonomy in archive page?
- Display posts the match taxonomy term linked from wp_list_categoies?
- Tracing the life of a query
- Want to redirect if search query match exact title of any post
- Why is my WP_Query not working when tax_query terms are an array?
- Pagination not working for Custom search form & custom result template
- How to support multiple search terms query within one process?
- Pagination broken when merging search results with additional WP_Query
- Move posts to top of WP_Query if in certain Taxonomy?
- Custom search form with empty parameters
- How to search by title or tags exclusively?
- WordPress search exact match
- Pagination wont work with search results template [duplicate]
- Querying Multiple Custom Taxonomy Terms
- How do I search WordPress by different fields without a plugin?
- Multiple keyword search
- Using next/previous_posts_link with customised search
- WordPress custom search form with pre_get_posts not work
- Search – Ajax – Alter Query Parameters with Pagination
- Add custom search results to main WP search [duplicate]
- Filter and list posts of a custom taxonomy
- Determine WP_Query parameters from URL
- WP Query – Get WooCommerce Products with variation that is in stock
- Multiple search queries on one page
- tax_query shows no results if nothing is selected
- Get the post permalink within the loop but without additional DB query
- Filter WordPress posts by between parameter
- How to Modify Taxonomy Archive Page with Search Parameter?
- How to add terms to my tax_query based off of the current post
- Searching through different categories on different pages code is not working
- Filtering posts by custom field value not working
- WP Query search for attachments and their exact title
- Display link to taxonomy archive only if it has posts with certain custom field values
- WP_Query’s “request” SQL Query
- Including only current user’s posts in search
- Multiple instances of Featured Image Query
- Order taxonomy terms in alphabetical order
- Is it possible to dynamically get queried term AND taxonomy?
- is_search was called incorrectly
- WP Query for variable taxonomies
- Pass array of taxonomy terms to wp_query
- Modifying the Search Results
- Custom category search box for WordPress
- Refine search results using WP_Query
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- Formulate a url to show posts with both taxonomy terms
- Search Posts with Custom Fields as query
- Complex date range with WP_Query and BETWEEN
- Rewrite rule to prettify two $_GET variables while in a new endpoint from a page
- Creating a custom search for a specific post type
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Custom Search Result Page displaying only 1 result.
- Order by slug in get_terms with multiple taxonomies
- Output an array of terms for a ‘tax_query’ => array()
- How to loop for every result found in the_content() when using the search query?
- Function get_queried_object() return NULL in custom taxonomy
- Assigning a meta_query value based on regexp to wp_query fails
- Getting Taxonomy inside WP_Query Loop
- showing all search result in one template
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Complex WP_Query (two post types and multiple operators)
- Is there any advantage of using default WordPress Search instead of creating a custom one?
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Search pages that are a child of the current page
- WordPress add_rewrite_rule() cannot visit lower url levels
- Include tags in WP_Query
- Search for multiple tags?
- Custom Search Not Consistent with Results
- Remove category from query (show all posts in archive.php) pre_get_posts()
- is_tax() function not working as expected
- Advanced Taxonomy Queries WordPress
- wp_query ‘s’, search filter with pagination is not working
- Display Featured Post by Categories and Avoid duplicated posts
- Editing the default wordpress search
- How to use wp_query to post count by search term > group post count by date > convert to json. (ex. result 12-21-2020 – 343)
- Multiple Search Terms WP_Query
- Get authors by term id or slug
- WP_Query tax query part of slug
- Taxonomy Query Relation field not behaving correctly?
- Extend product search with meta in WooCommerce
- How to Union two different conditions in one WP_Query
- Display filtered results into custom page
- Slow queries on a huge database
- WordPress pagination not working on template search.php
- Cutom wp_query for geolocation search, pagination not working
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- How do I exclude the lowest level terms in a taxonomy?
- query_vars overriding WP_Query args