Did you add your cpt to the search query ?
function include_cpt_in_search($query) {
if (is_admin() || !$query->is_main_query())
return;
if ($query->is_search) {
$query->set('post_type', array('post', 'page', 'your_custom_post_type'));
}
}
add_action('pre_get_posts', 'include_cpt_in_search');
Related Posts:
- How to get posts by content?
- What is the best way to mimic a search query within a plugin
- AJAX search posts and pages
- How to add the search page link to the anchor tag?
- WC Fix Attributes – ‘Add New’ Not Searchable/Delayed
- Can we install 3d product configurator into wordpress
- Get plugin_dir_url() from one level deep within plugin
- Notify Admins about Plugin Merge
- Adding Featured Image in Post List
- Why does including a file in theme’s functions.php not work?
- WooCommerce – Call to undefined function is_woocommerce()
- OEmbed from Pinterest
- Should I use RIPS tool to test my themes and plugins?
- Add Top-Level Menu that opens URL
- Plugin Functionality Only for Editor and Administrator
- Plugin to hide admin menu (vertical menu bar)
- Issue with post request to admin-post.php
- action-scheduler vs wp-background-processing
- Do you clean up your self-written plugins’ at deactivation?
- like to keep reading plugin
- Check if email address exists front end with AJAX in a plugin
- Global matrix for shortcodes/content for every page
- How to add class in plugin only for network site?
- Plugin Development sqlite or WordPress’ database
- How to write a plugin to add users to a mail list
- WordPress plugin for activating other plugins
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Combine scripts from all extensions of the plugin when an extension is activated
- WordPress plugin creation how to execute .sql in order to insert multiple rows at activation of plugin
- Checkbox conflict in my custom plugin admin page
- How to create a custom shortcode based on the layout?
- Can a Plugin Override New User Default Role Type
- How to let user store a file in plugin directory but not have it get deleted on update?
- Great blogs site resources/tutorial for WordPress Developers? [closed]
- Plugins ignored a line breaks or tag in the WordPress comment functions
- How to get path or root of plugin folder, not file or dir?
- Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?
- Change letters for day name
- (WordPress 5.8.3) Function.php or a plugin for better performance? [duplicate]
- What is the easiest way to rename a plugin (and also avoid plugin updates)
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Elementor Custom Control: How to get input value?
- Minimize and Uglify WordPress Plugin Files
- WordPress API functions not working at AJAX functions.php call
- Creating a search form and displaying results
- How do I show content from a plugin using the template the site is currently working with?
- How to check homepage contain blog post?
- Create “new pages” within the admin section of plugin
- More gentle way to hook WordPress custom url
- Creating a plugin that will display text on every page
- Xamp installed local wordpress not allowing to publish or install plugin
- How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
- WordPress cron job running more than once
- Using sessions or an alternative in a plugin
- Correct way to expand custom WordPress plugin functions
- How to access a wordpress plugin page or add posts without doing it from the WordPress dashboard?
- Hide content for specific users with id
- adding dynamic/multiple slug values in ‘option_none_value’
- Update wordpress user roles not working as excepted
- is it possible to fetch data from a remote api while admin is writing a new post?
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Can’t access 3rd party API, code works on local server but not on wordpress
- Custom author page for custom role
- Dynamical slug on custom post type
- multiple string replace of post’s content for large data
- Storing Array of values into wordpress options
- Using WordPress to create a simple web app (SaaS) [closed]
- Front End Page Not Loading Header Footer
- Media Upload to custom database and Custom Directory
- WordPress Add advertising ads befor and after content with periority [closed]
- TinyMCE how to add css when inputing a text
- Can plugin automatically update if i hide the update notification?
- woocommerce blank page after clicking add to cart [closed]
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- Apache rewrite rules and wordpress problem
- WordPress automatic plugin update
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- Many Field in Front End User Registration form insert as post
- How to list posts that appear in two categories
- Load my plugin before cache
- How to get current template file used by WordPress?
- Is it possible to debug plugins with Xcode?
- how to set approval of admin for wordpress posts submitted by the user?
- WordPress Plugin Reviewer
- Plugin to display text before a post
- Get all the related data from WordPress DB
- wp doesn’t recognize my plugin if I don’t login as WP user (or as WP Admin)
- Plugin to Display Content on Page
- WordPress s2 member plugin not working [closed]
- Possible to add “Template” selector to pages? Is Any Plugins are There..?
- How to get custom setting from get_option and pass it in getEntityRecords in gutenberg block?
- Display file contents within Plugin
- When to store store plugin options as a single database record?
- WordPress hack code issue, help required
- redirect logged users to custom front-end insetad of wp-admin
- How to list latest 5 posts from each author from a custom CPT? I want to create a custom Gutenberg block
- Custom uploader – Upload files and save link into database
- I have issue to retrive post thumbnail with rest api
- WordPress theme development – the template dropdown in Pages and disappeared
- Custom block based off core block using filter