WordPress.org

Ready to get started?Download WordPress

Forums

WP Family Tree
Show only year in tree (5 posts)

  1. mmmmagnus
    Member
    Posted 2 years ago #

    Thanks for a great plugin!!

    Is it possible to show only the year for birth and death in the tree view (not month and day)? The nodes gets to wide and I think it's enough if you get that information when clicking the info icon to get to that persons post. Can I modify family-tree.php to achive this?

    http://wordpress.org/extend/plugins/wp-family-tree/

  2. the_arv
    Member
    Plugin Author

    Posted 1 year ago #

    It would be possible to amend the date format through family-tree.php. Somewhere around line 91:

    $str .= '"Birthday='.$node->born.'",'."\n";

    I am afraid you will have to figure out the relevant PHP to format $node->born into the format you are looking for.

    The date format will be configurable in a release to be published soon.

  3. the_arv
    Member
    Plugin Author

    Posted 1 year ago #

    By the way... Thanks for the positive feedback! :-)

  4. mmmmagnus
    Member
    Posted 1 year ago #

    Great. Thanks! I will patiently wait for next release.

  5. Sodaburger
    Member
    Posted 1 year ago #

    If you want to display just the year change this code:

    $str .= '"Birthday='.$node->born.'",'."\n";
     if (!empty($node->died) && $node->died != '-') {
      $str .= '"Deathday='.$node->died.'",'."\n";
     }

    to this code:

    $str .= '"Birthday='.substr($node->born, 0, 4).'",'."\n";
     if (!empty($node->died) && $node->died != '-') {
      $str .= '"Deathday='.substr($node->died, 0, 4).'",'."\n";
     }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.