admin管理员组文章数量:1201413
I am using the following wp_query
to pull up a list of post, and I want to exclude a few categories of a custom taxonomy.
It works well, however Query Monitor is telling me that the query is slow.
I removed the 'tax_query'
part of the query and it sped up.
Is there a faster way to exclude these categories?
Thanks!
My Query:
$args = array(
'post_type' => array( 'recipe' ),
'post_status' => array( 'publish' ),
'order' => 'DESC',
'orderby' => 'date',
'posts_per_page' => 40,
'no_found_rows' => true,
'tax_query' => array(
array(
'taxonomy' => 'ingredients',
'field' => 'slug',
'operator' => 'NOT IN',
'terms' => array( 'onion', 'pepper', 'bean' )
)
)
);
本文标签: wp queryAny quicker alternative for WPQuery quotNOT INquot
版权声明:本文标题:wp query - Any quicker alternative for WP_Query "NOT IN" 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738596772a2101827.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论