Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active March 24, 2020 15:57
Show Gist options
  • Save vanaf1979/3318b4b258bc92270f4b4e30249df018 to your computer and use it in GitHub Desktop.
Save vanaf1979/3318b4b258bc92270f4b4e30249df018 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' => 'MacOS',
'compare' => '='
)
)
);
$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