Hello guys
In what is going to be my first big WordPress website, I have created categories like Cars, Boats, Airplanes, Motorbikes etc. These are the standard WordPress Categories.
In Advanced Custom Fields, I have created some more categories – in the form of choices (allowing multiple values), based on the brand of each of the above. For example, when the user makes a new post and selects the category cars, then the ‘vehicle_brand’ (Field Name) appears below the post with the choices like Opel, Citroen, Fiat, etc. In the ACF settings, this is like:
1 : Opel
2 : Citroen
3 : Fiat
4 : VW
5 : Audi
6 : Mercedes
So I have a category-cars.php file, which gives me all the posts with a car category. What I want is to be able to retrieve on this page, only specific brands with a filter. For example retrive only the Opel cars, and have them also paginated like 9 per page. Problably I’d have to use something like the code elow for a single and specific value. But now how I can get the result I want, based on the user choice. meta_key should be an array somehow…? Because I know than vehicle_brand is an array (if it has multiple choices). If not it’s a single value like get_field(‘billiard_category’)[0]
$args = array(
‘numberposts’ => -1,
‘post_type’ => ‘event’,
‘meta_key’ => ‘location’,
‘meta_value’ => ‘Melbourne’
);
Please help if you know. I couldn’t find this on the forum, or at least didn’t understand if I was looking something related to my issue.
Thanks!