I’m trying to make a query filtered with some dropdowns, so I’m using select - option element from HTML. The problem is that if I put an integer in the value, it redirects me to the 404 page, with a string it’s OK.
This is with a string and the var dump on the $_POST
Thank you for your response.
I will add my code because it will explain the situation much better.
It will make no difference if I would delete the php from the form.
I’m a bit confused. If using the variable $country->name is working correctly, I don’t understand why you are not using the variable $country->parent or whatever it is you need there. Using what looks to be a JSON object as an attribute value like that does not look correct to me.
I’m trying to make a page where I could filter(with a dropdown) the posts based on two(different) taxonomies terms.
My taxonomies are like this:
-taxonomy
-term
-subterm < based on this I want to filter
first taxonomy
-festival_categories
-countries
-germany (I want to filter only based on the countries)
-france
-italy
-cities
-berlin
-paris
-rome
second taxonomy
-festival_date
-year
-2018
-2019
-month
-january (I want to filter only based on the month)
-february
-march
This redirects me to 404.php, probably because the path(defined in option's value) is not valid. Or I am wrong?
The query is simple, I managed to filter something static(see the array commented in the code), but I can’t make it to filter by a dropdown.
@Mittineague You are correct, I changed the code. $country->name displays the taxonomy subterm(germany, italy…etc), it needs to display the name so it can be chosen in the dropdown, the $country->parent is the term(countries), I need it in the query. I edited the commented $args array so you could understand better.