Meta_Query – Query based on multiple custom fields key
-
When using this
$args = array( 'post__not_in'=>$do_not_duplicate, 'post_type' => 'any', 'posts_per_page' => 5, 'meta_query' => array( array('key' => 'iframe') ) );
I can get the posts these are having a custom field key iframe.
But when using this
$args = array( 'post__not_in'=>$do_not_duplicate, 'post_type' => 'any', 'posts_per_page' => 5, 'meta_query' => array( array('key' => 'iframe'), array('key' => 'video'), array('key' => 'videoflv') ) );
I can’t get any post at all.
Is this not the correct way of querying posts based on multiple custom field keys?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Meta_Query – Query based on multiple custom fields key’ is closed to new replies.