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 ..'
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 ..'
- Not Ajax but interesting use of array with inputs to search in several post types: wordpress.stackexchange/questions/286586/… – Jesús Franco Commented Jun 28, 2020 at 20:01
1 Answer
Reset to default 3This is documented here: https://developer.wordpress/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 );
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742308227a4419370.html
评论列表(0条)