admin管理员组文章数量:1291092
I'm building a query on a custom post type and some custom post meta.
Here is the query :
$meta_query = array(
'relation' => 'AND',
array(
'key' => '_thumbnail_id'
),
array(
'key' => 'offre_economie',
'value' => 'pending',
'compare' => '!='
),
array(
'key' => 'offre_app_partenaire',
'value' => 1,
'compare' => '!='
),
array(
'relation' => 'OR',
array(
'key' => 'offre_expiration',
'value' => '',
'compare' => '='
),
array(
'key' => 'offre_expiration',
'value' => date('Ymd'),
'compare' => '>=',
'type' => 'DATE'
)
),
array(
'relation' => 'OR',
array(
'key' => 'offre_fin_evenement',
'value' => date('Ymd'),
'compare' => '>=',
'type' => 'DATE'
),
array(
'key' => 'offre_fin_evenement',
'value' => 'null',
'compare' => 'NOT EXISTS'
),
array(
'key' => 'offre_fin_evenement',
'value' => '',
'compare' => '='
)
)
);
$query->set('meta_query', $meta_query);
It works perfectly fine on our testing site but when I put this last part on the final site :
array(
'relation' => 'OR',
array(
'key' => 'offre_fin_evenement',
'value' => date('Ymd'),
'compare' => '>=',
'type' => 'DATE'
),
array(
'key' => 'offre_fin_evenement',
'value' => 'null',
'compare' => 'NOT EXISTS'
),
array(
'key' => 'offre_fin_evenement',
'value' => '',
'compare' => '='
)
)
When loading additional pages the query is so slow and sometimes it doesn't even load.
I've found some info on this question Meta query terribly slow. But I still can't figure out why it works well on the testing site and not on the final one.
本文标签: Custom Meta Query doesn39t work the same on two site
版权声明:本文标题:Custom Meta Query doesn't work the same on two site 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741522936a2383295.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论