Results 1 to 4 of 4

Thread: Show age from date of birth custom fields.

  1. #1
    Thread Starter
    Junior Member mark1975's Avatar
    Join Date
    May 2010
    Location
    United Kingdom
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Show age from date of birth custom fields.

    Hi,

    I have created 3 custom fields with drop down lists with years, months, days all with a numerical value:

    cp_yearofbirth (1900 - 2020)
    cp_monthofbirth (01 -12)
    cp_dayofbirth (01-31)

    By editing the single-ad_listing.php I can show any or all of the fields by using:

    <?php echo get_post_meta($post->ID, 'cp_yearofbirth', true); ?> and changing the value.

    What I would like to do is use these 3 custom fields to calculate the age of the poster and display it. I know I will have to put the code into the single-ad_listing.php file which is fine as the whole file will be customised anyway.

    Does anyone know the code I need to do this?

    Thanks, Mark

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,982
    Thanks
    170
    Thanked 3,408 Times in 3,279 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  3. #3
    Thread Starter
    Junior Member mark1975's Avatar
    Join Date
    May 2010
    Location
    United Kingdom
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,982
    Thanks
    170
    Thanked 3,408 Times in 3,279 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Show Job Expiration Date in Job List
    By acsepic in forum JobRoller General Discussion
    Replies: 10
    Last Post: July 17th, 2013, 09:54 AM
  2. Custom Fields do not show up when viewing Add
    By ash2dust in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: December 26th, 2010, 09:42 PM
  3. We want to show the custom fields from the Ads listed in the current categorie
    By mr_green in forum ClassiPress General Discussion
    Replies: 4
    Last Post: December 16th, 2010, 06:33 AM