CPT UI search result
-
Hi, I wonder if my search results is normal
I generated data with fakerpress, and I pasted in the keyword “Exercitationem autem occaecati nobis” , it display any custom post type with any keywords in it, if the post contain any of the word autem,nobis,Exercitationem,occaecati in the title or the body content. It will display the post results. Is it normal ?
How do I set it so the words need to match all the string, or it need to match the title only not in the body content ?
I use the default function provided in doc
function my_cptui_add_post_type_to_search( $query ) { if ( is_admin() || ! $query->is_main_query() ) { return; } if ( $query->is_search() ) { $query->set( 'post_type', array( 'article' ), ); } } add_filter( 'pre_get_posts', 'my_cptui_add_post_type_to_search' );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘CPT UI search result’ is closed to new replies.