Portfolio Shortcode new WP_Query
// WP_Query arguments
$args = array(
'post_type' => array( 'portfolio' ),
'posts_per_page' => '3',
'order' => 'ASC',
'orderby' => 'menu_order',
'tax_query' => array(
array(
'taxonomy' => 'portfolio_category',
'terms' => array( 'animals', 'landscapes' ),
'field' => 'slug',
'include_children' => true,
),
),
);
// The Query
$portfolio_grid_loop = new WP_Query( $args );
// The Loop
if ( $portfolio_grid_loop->have_posts() ) {
while ( $portfolio_grid_loop->have_posts() ) {
$portfolio_grid_loop->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();