1

I actually wanted to reply to another post, unfortunately that is no longer possible.

Therefore a short and crisp question. ;-)

If I want to search in several post types, can I simply work with 'post_type' => 'post' with comma values?

'post_type' => 'post', 'Pages', 'etc ..'

1
3

This is documented here: https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters

So to search for several post types you do:

$args = array(
    'post_type' => array( 'post', 'page', 'movie', 'book' )
);
$query = new WP_Query( $args );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.