Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

same_artist wp_query

the wp_query for the same artist loop

// WP_Query arguments
$args = array(
	'post_type'              => array( 'folio' ),
	'order'                  => 'ASC',
	'orderby'                => 'name',
	'tax_query'              => array(
		'relation' => 'OR',
		array(
			'taxonomy'         => 'folio_type',
			'terms'            => array( 'profile', 'artist' ),
			'field'            => 'slug',
			'operator'         => 'IN',
			'include_children' => true,
		),
	),
	'meta_query'             => array(
		'relation' => 'AND',
		array(
			'key'     => 'folio_artist_name',
			'value'   => '$folio_artist_name',
			'compare' => '=',
			'type'    => 'CHAR',
		),
	),
);

// The Query
$query_same = new WP_Query( $args );