• I have a website for an acting agency, they’ve requested the actors age get calculated from their DOB automatically; I’ve accomplished this part with this simple PHP:

    $current_year = date('Y');
    $age = $current_year - $year_of_birth;

    Now, I need users to be able to select an age range (18-30, 31-45, 46 <) and the posts populate the page accordingly…

    I’ve got custom post-type female-talent
    Custom field year_of_birth

    I wanted to page a template that goes something like;

    if ($age =< 30) {
    } elseif ($age ...) {
    } else ( ) {
    }

    Any ideas?
    Thanks

The topic ‘Creating an age filter page ?’ is closed to new replies.