Hello imborx,
Add this code snippet below to the file “bp-custom.php” in the path “wp-content/plugins” :
https://gist.github.com/KaineLabs/f431ef4177757e61f9a638607c9879e0
Ps: if you didn’t find the file “bp-custom.php”, just create a new one.
Let me know if it worked fine for you.
Best Regards.
Hi @ukai-themes
That works perfectly, thanks a lot!! Also, how could I add the age to the user profile page?
@ukai-themes Following this link: https://gist.github.com/KaineLabs/f431ef4177757e61f9a638607c9879e0 If I want to show age in the profile page, I suppose that I need to add a hook to profile pages like it does with directoy:
if ( bp_is_members_directory() ) {
but I can’t make it work.
Do you know how could I do it?
Thanks
Hello,
Here’s i created this new snippet to make able to achieve that :
https://gist.github.com/KaineLabs/e56d80b52f081a3a28e6f8e41c3b3d4c
Good Luck.
Hi, thanks for the snippet!
I works but it’s displayed different than the members directory:
How can I set it the username + age in the same line (“username, 18”)?
Also, it is posible to style the $field_data? In the original snippet, the age it’s in bold weight (same as name) and I would like to set a regular font weight.
Hello,
Here’s i create another new snippet to add it to the profile header username :
https://gist.github.com/KaineLabs/ff5ec524a3ac66ddaf058b9d342091de
Also you can now use the class “.bp-user-age” to style it as you want.
I updated this previous snippet below, so you can style it also :
https://gist.github.com/KaineLabs/f431ef4177757e61f9a638607c9879e0
Best Regards.
Wow, thank you so much!
The new class/style works perfect, but after add that new snippet, the age it’s not included on my profile member pages (it did on members directory perfectly and with latest code in wrong place… but now in any part of the profile page). I think it’s be related with a custom hook of my WP template, could you take a look if it is posible? Just to be sure that works and I’m not doing something wrong.
I wrote you an email to your github email direction with the link of the webpage
Thanks again!!
Hi @ukai-themes,
Your help was really helpfull but I’m still stucked trying to show the age after the user nicename in members profile. Your previous code showed after the user_mentionname but I need after nicename. Is that posible? I attach you an image:
Thanks!