Do you want your users to search through specific post types only? If you have lots of content in your custom post types allowing users to search from custom post types can help them find the content easily.
By default Elementor or WordPress doesn’t search custom post types but with the Search Bar widget from The Plus Addons for Elementor, you can easily search posts from custom post types.
To check the complete feature overview documentation of The Plus Addons for Elementor Search Bar widget, click here.
Requirement – This widget is a part of The Plus Addons for Elementor, make sure its installed & activated to enjoy all its powers.
To do this, make sure you have created at least one custom post type, you can use the free Advanced Custom Fields (ACF) to create a custom post type.
For instance, we have created a custom post type called Books.
Then add the Search Bar widget on the page or template and follow the steps –
1. Open the item under Search Bar and select Post from the Source dropdown.
2. From the Select Type dropdown, select your custom post type i.e. Books here.
Note: Make sure to remove Posts, it will be selected by default.
Now, you should be able to see a dropdown beside the search bar.
In the Label field, you can add a label name for the select dropdown.
In the Placeholder field, you can add a placeholder text for the select dropdown.
From the Show Index toggle, you can show the number of posts the item has in numbers.
3. Now go to Extra Option tab and make sure the AJAX Search is enabled.
Note: The AJAX Search will be enabled by default.
Now you can select your Elementor search custom post type from the dropdown to show all the posts in the search result or you can directly search for the custom post type.
Also, read How to Search Posts by Custom Field in Elementor.