cpt ui plugin hidden single post type from search results in website

The solution for “cpt ui plugin hidden single post type from search results in website” can be found here. The following code will assist you in solving the problem.

function my_cptui_add_post_type_to_search( $query ) {
if ( is_admin() || ! $query->is_main_query() ) {
return;
}

$query->set(
‘post_type’,
array( ‘post’, ‘page’, ‘tour’, ‘struttura’, ‘offerta’, ‘project’ )
);
}

add_filter( ‘pre_get_posts’, ‘my_cptui_add_post_type_to_search’ );

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in