Hi,
Just to tie everything together - I actually didn’t need to use the Query String for Looper provider and just use the default query provided by archive layout. The main issue was that I wasn’t using the exact name under General>Name for the Select element as @TwoLuckyDucks suggested . This had to match with the name of the taxonomy. So instead of just “location” for the Name, when I changed to “publication-location” filtering worked as intended.
Regarding using ACF field as filter, it is a bit difficult and haven’t been able to do it yet. I might have to turn them in to taxonomy as well so it’s straight forward. AI helper suggested using custom loopers to get the unique entries of the “organisation” ACF field and then using it to populate the Select element. I used this code in the function.php to create a custom looper but just couldn’t get it to populate the Select element. I must be doing something wrong.
//-----------------------------------------------------------------------
//
/**
* Cornerstone Custom Looper: publication-orgs
* Returns unique ACF text values from field "organisation" on CPT "publication"
*
* Use in Cornerstone Looper Provider: Custom → publication-orgs
*/
add_filter('cs_looper_custom_publication-orgs', function($result, $args = []) {
// 1) Pull all Publication IDs
$ids = get_posts([
'post_type' => 'publication',
'post_status' => 'publish',
'posts_per_page' => -1,
'fields' => 'ids',
'no_found_rows' => true,
]);
// 2) Collect org values (ACF text field)
$values = [];
foreach ($ids as $post_id) {
// ACF stores text in post meta with the field name as meta key
$org = get_post_meta($post_id, 'organisation', true);
if ($org !== '') {
$values[] = trim((string) $org);
}
}
// 3) De-dupe + sort
$values = array_filter($values, fn($v) => $v !== '');
$values = array_values(array_unique($values, SORT_STRING));
sort($values, SORT_NATURAL | SORT_FLAG_CASE);
//4) Return array of objects so you can bind label/value easily
return array_map(fn($v) => ['label' => $v, 'value' => $v], $values);
}, 10, 2);
Is there a way to daisy chain the filter so that if you select the a top filter, the other filter will only show items if they are available with the new filter results?