The form has to updated as
<form id="cptsearch" action="<?php echo home_url(); ?>" method="get">
<input type="text" name="s" />
<input type="hidden" name="post_type" value="POSTTYPENAME" />
<input id="searchsubmit" type="submit" alt="Search" value="Search" />
</form>
Related Posts:
- Group search results by post type, but hide post types with no results
- how to get this tax_query working?
- Searching post types
- Search form to find custom meta box generated data
- WordPress search results grouped by post type
- Get a custom post type’s taxonomy type term names displayed as checkboxes and filter
- search also in taxonomy, tags and custom fields
- Custom post type search using $_SESSION and pre_get_posts
- How to stick custom post at the top in search results
- filter custom post type by meta key in dashboard
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Can I search only some of the fields of a custom post type?
- Custom Post Type And “fopen”
- Help need making decision. Ads rotating site on wordpress
- Query & Order posts by custom fields
- Filter custom posts using auto populated dropdown selectors
- custom taxonamy and post type
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Make parts of your wordpress website completely built with data from external APIs?
- WordPress sort search results by custom order
- Return the latest post from a custom Taxonomy and Post Type
- Don’t know how to show custom taxonomies from a custom post_type
- Not Able to Get Custom Post Type Gallery Images URL
- JS innerhtml changing style when using AJAX
- Display a grid of taxonomy terms at root taxonomy page
- Including metaboxes from custom post types in global search — continued
- Custom post type not showing in search result
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- How to change the post type a theme shows by default?
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- What to and how to proceed with CPT to make DB small and efficient?
- Pretty URL for custom search for custom post type
- Add post location with mile radius allowing search
- Include custom post type content in search
- Get post count for search result based on post type
- Event Custom Post Type Title show by upcoming Event Dates
- How to have this permalink structure: post_type/postname/custom_inner_page
- Auto Complete Search
- search suggest – filter post type
- Searching Custom Post Types
- Building a Treatments Page, What Do I Use?
- How do i search authors from search form using author’s name
- Remotely search WordPress sites using xml-rpc
- Custom post types and category archive
- BBPress Search results in WordPress search
- Limit Search to Post Type With Apostrophe return search not found
- Search filter triggered & sort by custom post type
- Set Custom Post Type in Widget Settings for use in Widget
- Displaying and searching Custom Posts
- Search by tag name and category
- custom comments form for custom post type
- How to produce a sub-page-system in WordPress
- Searching Custom Fields
- Advanced search form with filters for custom taxonomies
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- filter search custom field query
- Different results between permalink and query var search
- How to let users choose where to search for posts?
- WordPress Custom Search by post_type
- Include custom taxonomy term in search
- WebP Fallback for Inline Background Image in Style Attribute
- How to specify a template for a path like http://example.com/something?
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- What content types are shown at a search page?
- Can NOT search my custom post type?
- Warning: Invalid argument supplied for foreach() in post.php [closed]
- Search one custom post type ONLY, disable “all posts”
- Custom post_type search pages
- How can i link a custom post type thumbnail to intermediate size
- i cant see the max_num_pages of a custom wp query
- Pagination Error : Duplicate argument being outputted
- Archieve.php not loading for custom post type
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- WordPress search and date filter not working with custom post type
- Custom Empty Results page for my Custom Post Type
- detect your custom post type in WordPress
- Display custom post using ID
- Custom WP_Query doesn’t display all posts
- Specify a particular page to list all custom types
- WordPress app page not found error for posts with hyphen in permalink
- Where is the sticky post option?
- Custom filter for main search: how to exclude specific post_type from search results
- Two column layout with alphabetical ordering
- Create a comments template for custom post types
- Add custom attributes to a post
- Custom post type permalink sends to 404.php
- WP_Query with custom post type ID
- Display an icon based on post type
- Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)
- Select2 AJAX and WP Query Returns ALL and does not filter
- Custom Taxonomy Search result page
- How to group search results by post type and only if post type result is not empty?
- find custom post type post by searching its custom field with my string
- search custom post type by custom fields on front end
- Show Taxonomies with admin area for custom post type?
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- Pagination doesnt work in custom post type
- Archive links for custom post types
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?