WordPress meta query not working
-
Hi
First of all thanks for your time making this plugin.
I have wordpress installed on a server using sqlite. Everything works fine except when I am doing the below meta query the WP_Query don’t return any posts. With tax_query there is no problem.
function rlp_get_posts($post_type = 'native', $num = 10, $offset = 0){ $args = array( 'posts_per_page' => $num, 'offset' => $offset, 'orderby' => 'id', 'order' => 'ASC', 'post_type' => $post_type, 'meta_query' => array( array( 'key' => 'rlp_native_age', 'value' => array( '18', '78' ), 'type' => 'numeric', 'compare' => 'BETWEEN' ) ) 'post_status' => 'publish', 'suppress_filters' => false ); return new WP_Query( $args ); }
I tried to change the values in the array to int (because I take this value from a form as a string) with no luck.
On localhost with mysql everything works fine.Same content, same custom posts.
get_post_meta
works fine also.Thanks in advance.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WordPress meta query not working’ is closed to new replies.