WP_Query stalls the website
-
Hi I’m working on a new plugin, and I’m using the WP_query.
I checked the documentation and it’s not really clear if a query like the one below should work.
on my plugin it doesn’t work and most of all it stalls the website. Any suggestion on how to make it work?$query = new WP_Query( array ( 'posts_per_page' => -1, 'post_type' => $my_post_type, 'orderby' => 'rand', 'meta_query' => array( 'relation' => 'OR', array( 'relation' => 'AND', array( 'key' => 'first_key', 'compare' => '=', 'value' => 'first_value' ), array( 'key' => 'second_key', 'compare' => '>=', 'value' => 'second_value', 'type' => 'numeric' ), array( 'key' => 'third_key', 'compare' => '<=', 'value' => 'third_value', 'type' => 'numeric' ), array( 'key' => 'fourth_key', 'compare' => '=', 'value' => 'fourth_value' ), ), array( 'relation' => 'AND', array( 'key' => 'fifth_key', 'compare' => '=', 'value' => 'fifth_value' ), array( 'key' => 'sixth_key', 'compare' => '>=', 'value' => 'sixth_value', 'type' => 'numeric' ), array( 'key' => 'sevnth_key', 'compare' => '<=', 'value' => 'sevnth_value', 'type' => 'numeric' ), array( 'key' => 'eighth_key', 'compare' => '=', 'value' => 'eighth_value' ), ), ), ) );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WP_Query stalls the website’ is closed to new replies.