function somarket_search_all( $query ) { if ( $query->is_search ) { $query->set( 'post_type', array( 'post', 'page', 'products', 'wiki', 'places', 'product' ) ); } return $query; } add_filter( 'the_search_query', 'somarket_search_all' );

Add custom post types to WordPress search. Code example
Approved. Code works!
This is exactly the working code that is verified by the moderator or site administrators
More
lil-code© | 2022 - 2025
Go Top