This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko 1 year, 7 months ago.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Excluding custom post type from a search
This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko 1 year, 7 months ago.
Hello,
I am facing an issue with one of my search bars (in total 2 on the site) and I was wondering if you can help me out. I want to exclude certain custom post types from the search result page. I have followed the guides that you have provided and also set the override method and yet it’s not working. I do see an option to exclude cpt by ID but I was wondering if there’s a way to place a code in functions.php that will exclude a list of cpts?
Thanks!
Hi!
By default, the plugin should return only the post types selected under the General Options -> Sources
panel: https://i.imgur.com/Qh6Vazb.png
Was the search executed via the plugin search field?
If yes, and the override is still not working, you can still try this option.
If it is still not working, then there is very likely a custom query somewhere in the search template file, or in the theme functions.php file. There is certainly a way to exclude post types from that query, however it depends on the implementation – so you may need to ask the theme author about that.
You must be logged in to reply to this topic.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |