Forums › Forums › Search & Filter Pro › Filter by Age
- This topic has 3 replies, 2 voices, and was last updated 5 years ago by Trevor.
-
Anonymous(Private) December 19, 2019 at 1:38 pm #229467
I haven’t been able to get this to work yet as I’d like.
I have a CPT that lists various opportunities, some however are looking for people within specific age ranges and I would like for people to be able to enter their own age in a text field and see results that are appropriate to themselves.
I have two variables in my CPT AgeMin and AgeMax. This sets a rage for the type of person the the opportunity is focused on.
Is there a way I can set this up so that a visitor can simply type in their age (say:35) and the results would then compare the AgeMin and AgeMax numbers and IF their age is in between, then the opportunity shows in the results?
Currently I have this set as a dropdown field where people can select their age, but this isn’t as effective as a text input field would be because some studies have no max, and therefore I set a max age 120. This creates too many dropdown options.
The Range Number option is what I need, but there doesn’t appear to be a single field option like there is with the drop down.
Any suggestions? Or can the Range Number option get updated to provide for a single field option?
Trevor(Private) December 19, 2019 at 5:36 pm #229525The best thing to do is to use the range option, and hide one of the fields (using CSS display: none), where it has a fixed value. Maybe the From field set to 0 and hide that, and set the field like this:
https://www.screencast.com/t/KPVyzHZY
Ignore my use of the _author field, use your own min and max age fields.
-
AuthorPosts