Created
April 29, 2022 21:09
-
-
Save someguy9/55b7291a03f893f951c1e21d63ddd02a to your computer and use it in GitHub Desktop.
Query Posts By a Meta Value
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 | |
$meta_query_args = array( | |
'meta_query' => array( | |
array( | |
'key' => 'featured_post', | |
'value' => 'yes', | |
'compare' => '=' | |
) | |
) | |
); | |
$meta_query = new WP_Query( $meta_query_args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment