Created
June 4, 2019 07:31
-
-
Save yanknudtskov/cbed527ed68f87fc58b07147fb454669 to your computer and use it in GitHub Desktop.
get_posts meta_query example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$posts = get_posts( array( | |
'numberposts' => -1, | |
'post_type' => 'student', | |
'post_status' => 'publish', | |
'meta_query' => array( | |
'relation' => 'AND', | |
array( | |
'key' => 'acf_student_group', | |
'value' => $group_id, | |
'compare' => '=', | |
), | |
array( | |
'key' => 'acf_student_archived', | |
'value' => false, | |
'compare' => '=', | |
), | |
), | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment