admin管理员组文章数量:1336106
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 );
本文标签: How to search for many post types
版权声明:本文标题:How to search for many post types? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742308227a2450347.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论