Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author xnau webdesign

    (@xnau)

    The best way to do this is to use a custom template, then modify the out put to add your age value. You’ll need to know some PHP to get this done, but it’s not hard to grab the date value and calculate an age from it, then show the result.

    How to Create Custom Templates

    Would this also be a way to calculate and display “Firstname Lastname” rather than the two separate fields? I’d like to be able to display alphabetized but conventionally displayed names without using two separate columns.

    We’re using a plugin called Media Library Assistant (MLA) to manage images and import image metadata into WordPress, and one key field for image files is “PersonInImage” (populated by photoshop and other image software). Since the people in the images are the same people as the ones listed in our Participants Database, I’m thinking about ways to coordinate the two datasets. It should be possible to use MLA to create a tag cloud of names (pulled from the image attachment metadata) and set the links to the pdb single record page. Then the MLA gallery shortcode could generate a gallery of all images in which that person is tagged. I haven’t looked very far into the single record page yet, but it’s dynamically generated, yes? So I can create one page with the rules for what should display for each individual’s record?

    I guess it does make more sense to manage calculated data (like age, or this combination of two fields) on the display end, rather than in a distinct field.

    Plugin Author xnau webdesign

    (@xnau)

    This probably would have made a good new thread, since it involves interacting with another plugin and doesn’t help answer the origial question.

    Take a look at this article on creating custom templates. Each shortcode uses a template much like a WP template to format it’s output. You can easily bring in content from other sources and integrate it into the plugin output by using values in the PDB record to select data from another plugin.

    Using Custom Templates

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Calculate age from date field’ is closed to new replies.