// 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?
- 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?
- How to support multiple search terms query within one process?
- Move posts to top of WP_Query if in certain Taxonomy?
- Custom search form with empty parameters
- Querying Multiple Custom Taxonomy Terms
- Search – Ajax – Alter Query Parameters with Pagination
- 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
- 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
- Including only current user’s posts in search
- Multiple instances of Featured Image Query
- WP Query for variable taxonomies
- Custom category search box for WordPress
- Refine search results using WP_Query
- Search Posts with Custom Fields as query
- Assigning a meta_query value based on regexp to wp_query fails
- Getting Taxonomy inside WP_Query Loop
- wp_query ‘s’, search filter with pagination is not working
- Display Featured Post by Categories and Avoid duplicated posts
- Get authors by term id or slug
- How to Union two different conditions in one WP_Query
- WordPress pagination not working on template search.php
- Cutom wp_query for geolocation search, pagination not working
- How do I exclude the lowest level terms in a taxonomy?
- query_vars overriding WP_Query args
- how can I override The Events Calendar query modifications?
- How to display an other custom post type in a different custom post type’s archive?
- How to make search for posts using get method?
- wp_query args adding muitiple tax_querys
- How to get list of posts from permalinks?
- Pagination for blog posts reloading same page [closed]
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- Search posts missing a particular custom field
- How do I get my custom query to work with search results after the first page?
- Replacing search results with custom external query
- Prevent author bio page from showing in search results
- Get a list of posts by specific category
- WordPress Custom Search Form Displaying Unexpected Results
- Get posts from multiple tax terms
- Default permalink structure causing Notice: Undefined property: WP_Query::$post
- How to Order a list of taxonomies? orderby?
- How to add custom meta to ‘pre_get_terms’?
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- Slow Query On Search
- Get posts in taxonomy randomly
- Sorting search results with custom dropdown
- How To Keep Search Title the same on paged Results
- Filter out a meta key in the Search results page with two CPT
- Don’t repeat posts from children in parent taxonomy query
- Can I make a search query which includes a space?
- Show multiple tax_query from 2 or more post_type in a single code
- Searching not only by post name but also category
- Strange behaviour of hierarchical taxonomy archive
- Block internal search queries with pre_get_posts and regex rules
- How can I order a post query’s results based on the number of matching taxonomy terms?
- How to make the WP query search for the “s” arg in other places too
- Only show tag with the same id as the post
- Search Exact on WordPress – Relevannsi Solution Not Working
- Excluding posts from search results page with meta query not working
- How to use the Term Object from a custom select field in a query
- I have problems with the search query using multiple post types
- WP_Query no result if keyword contains number
- wp_query with meta_query and tax_query
- How to extend WP_query to a specific table?
- Display Search Results by tag_ID in my search.php
- getting posts by tags
- How to break up output of posts for different terms on same page?
- Add to search posts query array with post IDS which will appear first
- Custom Post Type WP_Query with filters and search
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- Get posts by similar names and categories
- taxquery taxonomy get terms
- Logging search queries for logged-in users
- pages shortcode filtering by category
- Search Field that allows options of “Match any keyword” or “Match all keywords”
- A very strange problem with search query
- Search Functionality broken by the wp 4.2 update
- Custom search (wp query by custom fields)
- Custom Search Query – include only custom fields and title
- $wp_query when new WP_Query
- Search Query that Includes Custom Table
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- Advanced Search – Is this possible?
- How to include custom fields in wordpress search
- Extend search query to search meta keys values based on search string
- AJAX multiple search boxes not merging with array merge