1

you can try this one function exclude_some_post_type($query) { if ( ! is_admin() && $query->is_main_query() ) { if ( $query->is_search || is_home() ) { // in search page $query->set( 'post_type', 'post' ); } } } add_action( 'pre_get_posts', 'exclude_some_post_type' ); The function that applied ...


Only top voted, non community-wiki answers of a minimum length are eligible