Support

Account

Home Forums Front-end Issues HELP: Filtering by ACF field in Archive Reply To: HELP: Filtering by ACF field in Archive

  • UPDATE:

    Sorted it.

    Needed a tax_query

    End result that allowed me to filter archive based on the taxonomy:

    
    // Filter by Taxonomy when needed.
    if ($_GET['discipline']) :
    	$term = get_query_var('discipline');
    	$args = array(
    		'post_type' => 'case_study',
    		'tax_query' => array(
    			array(
    				'taxonomy' => 'discipline',
    				'field' => 'slug',
    				'terms' => $term,
    			)
    		)
    	);
    else :
    // show everything
    	$args = array(
    		'numberposts'	=> -1,
    		'post_type'	=> 'case_study',
    	);
    endif;