Add this line –
<?php $search_query['post_type'] = 'products'; ?>
Just before the line –
<?php $search = new WP_Query($search_query); ?>
Related Posts:
- grep for special characters in Unix
- How do I remove Pages from search?
- How does WordPress search work behind the scenes?
- Remove meta robots tag from wp_head
- WordPress blog with 30 000 posts: poor search performance
- Template issues getting ajax search results
- Link to search page without search parameter
- How do I search events between two set dates inside WP?
- Search Using Post ID
- template_include for search.php makes WordPress think its on the home page
- Include custom table into search results
- How to stop _wpnonce and _wp_http_referer from appearing in URL
- Return all Tags from search results
- Search results with custom loop don’t update when paged
- ElasticPress Indexing multiple sites
- How to search through pdf media files?
- WordPress Single Conditional for Search Page
- Do not allow to search certain words
- get_query_var(‘s’) not working
- Display title for search engine visitors
- intellisense in wp search
- How to avoid the specific page while searching in WordPress without plugin?
- How to show a random selection of posts from the search
- Related Tags Concept
- Default WP search excluding specific characters, is it possible?
- Comparing between a negative and positive number
- Searching by meta values showing inappropriate result
- Search by keywords with boolean operators
- Remove WHERE conditions from search query
- Redirect All Search Links Containing – to + on WordPress
- How to make wordpress Dynamic Search-Bar from Predesigned Static Html Search-Bar?
- Change Search url slug for each site in a multisite network
- URL search link for ‘category__and’ instead of php query
- Search media by title and description – Frontend
- Is there a way to add a custom text + link above search results for different searches?
- How to change tab’s title in search results pages? [closed]
- Customise Excerpt start and end
- Generate list of tags from search results
- Template issues getting ajax search results
- How can I implement Search feature for Membership site?
- WordPress search with quotations returning to homepage
- Search queries don’t seem to work?
- How to display search results in search.php
- Array_search ignoring the first element [closed]
- Search WooCommerce Products in WordPress
- Order search results by category
- Should I create a parent page with no content? [closed]
- some one help . search not jump to search page
- Why should we use the name attribute with the value “s” in the creation of the search form?
- The Search FoRM Dilemma || The Search form Templating
- Search for anything in site
- How can I add search box in single.php?
- adding more text to a query string
- Connecting Google Site Search with WordPress Taxonomies/Categories/Tags
- When clicking on submit from my searchform it takes me to home.php
- My default search is not working
- Dashboard search function doesn’t work well
- My search form finds page 1 results but shows “error 404 page not found” on pages 2 on or clicking next
- twentyeleven theme: Where is the code that handles moving the search bar on resize?
- Displaying a list of tags in my archives page
- Page 2 of Search Results shows homepage
- Extend product search to search in attributes
- Search custom posts by meta key in admin
- Return All Tags from Search Result in Separate List
- Custom database table and custom search
- Can I replace the search bar with Programmable Search by Google?
- Banning special characters in search form input
- How to get search result as image rather than page
- Search within the current page
- Is it possible to show subdomain posts in main domain search result?
- What are the available options for “Name” in WP search?
- how to make search with two input boxes
- WordPress search with more input fields?
- WordPress search not able to find the category
- Editing a Search Form
- how to prevent the spam on search function?
- I have dynamic title tag in my wordpress but seo analyst show “No title Tag found error”?
- pre_get_posts improperly searching revisions
- Why is wp_dropdown_categories not searching within the sub-categories in my custom taxonomy
- Change output URL Search module
- limit the number of searches
- Customizing Google’s Search box in WordPress [closed]
- How can I prevent the Search Results Page from changing title?
- Problem with site’s search results “Read More” link?
- Custom search page and url in multilanguage
- I’ve messed up the admin search functionality. Help!
- Content instead Excerpt on term
- Make the title and […] clickable in result search
- Search multiple custom post types with tags
- wp_redirect and search engine bots
- Strip the + symbol from the_search_query
- Putting Text in the Search Box. eg- “Search My Site” [closed]
- How to remove search bar from the blog post
- Search and replace titles of posts with specific tags
- How do I turn this form into a search form? [closed]
- Custom WordPress Excerpt within terms
- WordPress Search – Reject partial matches
- Need help to be able to searching by tag and title
- Wp query search built out of 4 terms?
- Ivory Search error