Home › Forums › General Issues › Filtering issues which remove images and filters on page › Reply To: Filtering issues which remove images and filters on page
Ok so I’ve managed to get my images pulling through even when filtering which was a simple fix of changing the Return Value of the “film_poster” field to Image ID. It now works when I’m viewing the standard /films page as well as if I send a query (e.g. /films/?film_genre=Action).
However, I’m still having problems with the filters disappearing when the query is sent (e.g. apexcinemas.andrewcourtney.co.uk/films/?film_genre=Action) – any ideas?
Below is the code I have running in the functions.php page, taken from the ACF tutorial I mentioned before 🙂
// filter film genre
// Get original meta query
$meta_query = $query->get(‘meta_query’);
// allow the url to alter the query
// e.g. ?film_genre=comedy
$film_genre = explode(‘,’, $_GET[‘film_genre’]);
// Add our meta query to the original meta queries
$meta_query = array(
‘key’ => ‘film_genre’,
‘value’ => $_GET[‘film_genre’],
‘compare’ => ‘IN’,
// update the meta query arguments
// always return
Thanks in advance!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.