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’)
same my problem, but I need field using to choose the parent category only (without subcategory) and other field using to choose the child category only from the parent category that have been chose from the first field (parent category) in create custom post ..