G

Untitled

public
Guest Jun 11, 2024 28 days 9
Clone
PHP paste1.php 5 lines (5 loc) | 182 Bytes
1
add_action( 'pre_get_posts', function( $query ) {
2
if ( !is_admin() && $query->is_main_query() && $query->is_search() ) {
3
$query->set( 'post_type', 'post' );
4
}
5
});