testimonials
// WP_Query arguments
$args = array(
'post_type' => array( 'testimonials' ),
'post_status' => array( 'publish' ),
'order' => 'DESC',
'orderby' => 'date',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'testimonials_type',
'value' => 'library',
'compare' => '=',
'type' => 'CHAR',
),
),
);
// The Query
$librariansquery = new WP_Query( $args );
// The Loop
if ( $librariansquery->have_posts() ) {
while ( $librariansquery->have_posts() ) {
$librariansquery->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();