Query Posts Taxo Share Holder
// WP_Query arguments
$args = array(
'post_type' => array( 'post' ),
'post_status' => array( 'publish' ),
'nopaging' => true,
'posts_per_page' => '-1',
'order' => 'ASC',
'orderby' => 'date',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'category',
'terms' => '$shareid',
'field' => 'term_id',
'include_children' => false,
),
array(
'taxonomy' => 'post_tag',
'terms' => '$holderid',
'field' => 'term_id',
'include_children' => false,
),
),
);
// The Query
$post_taxo_share_holder_query = new WP_Query( $args );
// The Loop
if ( $post_taxo_share_holder_query->have_posts() ) {
while ( $post_taxo_share_holder_query->have_posts() ) {
$post_taxo_share_holder_query->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();