Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active March 24, 2020 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanaf1979/5000096b18139fcbaf7f6406fe4e9620 to your computer and use it in GitHub Desktop.
Save vanaf1979/5000096b18139fcbaf7f6406fe4e9620 to your computer and use it in GitHub Desktop.
Snippet #010 Filter posts by (Acf) Meta values https://since1979.dev/snippet-010-filter-posts-by-acf-meta-values/
<?php
$args = array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'os',
'value' => array('MacOs','Linux'),
'compare' => 'IN'
)
)
);
$macos_posts = get_posts($args);
print_r($macos_posts);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment