i want to exclude all wordpress pages from all wordpress queries.
My idea to solve this problem was to set the posttype in pre_get_posts
function meta_filter_posts( $query )
{
$query->set( 'post_type' => 'post' );
}
add_filter( 'pre_get_posts', 'meta_filter_posts' );
But it doesn’t work. I get no results. Why?
The correct syntax is:
Try it: