Not finding custom post type (with ACF)
-
Hello,
I am writing to you because -even though the standard solution should be a couple of lines in functions.php- your plugin is the only thing so far that provided me with some result, even though not yet what I need.
What I need is simply to include my only one custom post type in the search results (the default WP search).
A BIT OF INFORMATION:
In this custom post type I’ve added some custom fields with ACF.
In the CPT I’ve disabled the “editor” capability, because the “content” is given by a CF.
I’ve put the CPT in a custom plugin, which is correctly registered and activated, in fact I’ve already added some posts with this CPT.The CPT is registered with:
'public' => true, 'show_ui' => true, 'exclude_from_search' => false, 'publicly_queryable' => trueIn your plugin’s setting screen, all of the checkboxes in “General Search Setting”, “Select Meta Key Names” (including the custom ones), “Select Taxonomies” and “Select Post Types” (including my custom one) are checked.
WHAT I GET:
As stated before, I only get results related to my CPT when the search terms appear in the “Media” post type, I.E. if I add an image to my CPT; so basically it’s not even a result from my CPT since the search is done in the “Attachment” post type.
If I don’t use your plugin and I just go for the “standard way”, I.E. adding something like
$query->set( 'post_type', array( 'mycptname' ) );
in functions.php, I don’t even get those results from “Attachment”, and that’s why I’m trying to ask you if you have the slightest idea of what may be occurring here.Thanks a lot even just for having read so far.
Marco
The topic ‘Not finding custom post type (with ACF)’ is closed to new replies.