Query Brand Boxes 2023 Lucerne 1
// WP_Query arguments
$args = array(
'post_type' => array( 'sqppbrand' ),
'nopaging' => true,
'posts_per_page' => '-1',
'order' => 'ASC',
'orderby' => 'name',
'tax_query' => array(
array(
'taxonomy' => 'sqpptaxobrandproject',
'terms' => '2023-gwand-lucerne',
'field' => 'slug',
),
),
'meta_query' => array(
array(
'key' => '2023_luz_admin_brand_box_publish_yn',
'compare' => 'EXISTS',
),
),
);
// The Query
$query_brand_boxes_2023_lucerne = new WP_Query( $args );
// The Loop
if ( $query_brand_boxes_2023_lucerne->have_posts() ) {
while ( $query_brand_boxes_2023_lucerne->have_posts() ) {
$query_brand_boxes_2023_lucerne->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();