Courses Query (Healing ALS)
// WP_Query arguments
$args = array(
'post_type' => array( 'courses' ),
'post_status' => array( 'publish' ),
'nopaging' => false,
'posts_per_page' => '12',
'posts_per_archive_page' => '12',
'order' => 'ASC',
'orderby' => 'title',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'course-category',
'terms' => '47-steps',
'field' => 'slug',
),
),
);
// The Query
$courses_query = new WP_Query( $args );
// The Loop
if ( $courses_query->have_posts() ) {
while ( $courses_query->have_posts() ) {
$courses_query->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();