Hi All,
I have a CPT with an ACF group to build case studies (projects). One of the fields in the case study is a checkbox list of ‘disciplines’ pulled from a custom taxonomy.
I can display a full archive (/projects/), and I can display individual projects (/project/my-project-1) without issue.
In the individual project display, I have added a link to the key disciplines to link them to /projects/discipline=Discipline%20Name
on the archive page I have added the following to try and only display projects tagged with the discipline:
// args
if (!$_GET['discipline']) :
$args = array(
'numberposts' => -1,
'post_type' => 'case_study',
);
else :
$args = array(
'numberposts' => -1,
'post_type' => 'case_study',
'meta_query' => array(
'key' => 'discipline',
'value' => $_GET['discipline'],
'compare' => 'IN',
)
);
endif;
var_dump($args);
$the_query = new WP_Query( $args );
// display project list
The $args dump looks correct:
`array(3) {
[“numberposts”]=> int(-1)
[“post_type”]=> string(10) “case_study”
[“meta_query”]=> array(3) {
[“key”]=> string(10) “discipline”
[“value”]=> string(20) “This Discipline”
[“compare”]=> string(2) “IN” }
}
but the query isn’t affected and still displays all projects in the list.
Where am I going wrong?
I don’t need ‘live filtering’, just the link in a single project to be able to show a list of all projects in the same discipline.
Any pointers would be awesome – scoured the main docs, but can’t find any clues.
Ben