Instantly share code, notes, and snippets.

Embed
What would you like to do?
Querying content by a meta key
<?php
$args = array(
'meta_key' => '_affiliatedCompany',
'meta_value' => $companyID,
'post_type' => 'article',
'posts_per_page' => 20,
);
$r = new WP_Query( $args );
if( $r && $r->have_posts() ) :
// the loop
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment