-
Author
-
November 11, 2013 at 11:39 #6399AnchoraParticipant
Hi!
I noticed, that there is displayed the same age for every member in the members-loop.
Though, on the profile-pages the ages are displayed correctly.Thought that could be an issue with xprofile (show age instead of birthday), but thats not so.
Any ideas?
Thanks!
November 12, 2013 at 01:58 #6455SQadminKeymasterHi,
Maybe is related to some custom code added or plugin used. In our demo it looks goodHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 12, 2013 at 10:03 #6476AnchoraParticipantIndeed a problem with Xprofile!
Newest version 1.5.7.9…Would there be a way then to show the age in profile, without xprofile?
(in the first try, i only disabled “show age instead of birthday”, instead of disabling the plugin)
November 13, 2013 at 00:28 #6535SQadminKeymasterIn our theme we used default buddypress xprofile date field. Just set it under Sweetdate – Buddypress – Age field
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 13, 2013 at 04:57 #6555AnchoraParticipantThis is what I had before.
But on profilepages, there’s shown the birthdate then, instead of the age!November 14, 2013 at 12:44 #6609SQadminKeymasterYou can add this code to show the age in the profile:
COPY CODE/* Birthday to age in profile page */ bp_get_the_profile_field_value(); add_filter('bp_get_the_profile_field_value', 'kleo_age_field',10,3); function kleo_age_field($value, $type, $id) { $age_field = sq_option('bp_age_field'); if ($age_field == $id) { $value = xprofile_get_field_data($id); $diff = time() - strtotime($value); $age = floor($diff / (365*60*60*24)); $value = sprintf( _n( '%s year', '%s years', $age, 'buddypress' ), $age ); } return $value; }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 14, 2013 at 13:11 #6619AnchoraParticipantYes, therewith the age is shown – but on every profile ONLY the admins age!
It is the same result as with xprofile.I’ve totally disabled total-cache for that + cleared cache/-cookies in browser.
November 15, 2013 at 00:59 #6695SQadminKeymasterI have updated the code. Try it now
Regards,
AbeHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 19, 2013 at 13:28 #8551cougarmenParticipanti have the same problem.
on profile header it shows the birthday date instead of age. i’d like to put the code you gave but i don’t know the file name and its location.
Please could you help me
Thanks
December 19, 2013 at 13:33 #8552AnchoraParticipantput it into functions.php of your sweetdate-child!
December 19, 2013 at 13:49 #8553cougarmenParticipantok great thanks a lot it worked for me.
But i still have a problem : age appears correctly but the field name is still “date of birth” instead of “age” how do i replace it ?
December 19, 2013 at 13:55 #8555AnchoraParticipantcheck your sweetdate settings in admin-dashboard
December 19, 2013 at 14:10 #8556cougarmenParticipantif you mean to set age label to “age” i already made it but still not working
December 19, 2013 at 14:15 #8557AnchoraParticipantdid you also do it in the members/profile-fields section of wp?
December 19, 2013 at 14:32 #8558cougarmenParticipantOk i changed it, it’s not a perfect solution but will be ok for now.
Thanks
December 20, 2013 at 01:17 #8578airsidworldParticipantHI,
Code is working well.
Just an styling issue: the age is show in black which is not the same color of other answered fields according to the color define in sweetdate => styling options (in my case in green).
Would you have a quick css code for it ? -
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.