Adding Age Based WordPress Category

You might like to:

  • Use a custom field as @Fayaz mentions above. Advanced Custom Fields will be the best for this (and you have it already).
  • Add a new field (and I’d call it ‘Year of birth’) using Range. You could use a datepicker, but this way it’s cleaner and less intrusive:

Year of birth

  • This will then give you nice stable meta data for each post (‘stable’ as in their ‘year of birth’ doesn’t change; age does!).
  • You can then ‘call’ that meta data depending on what you want.
  • If you wish to reference posts that are of a certain age range, you can do this with a WP_query using meta_query.
  • If you want to show someone’s age on a post, you could use current_year minus Year-of-birth.

Note that this requires some level of development. This is WordPress development after all..!