Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display age after the name (members directory)

Viewing 8 replies - 1 through 8 (of 8 total)
  • @ukai-themes

    Participant

    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.

    @imborx

    Participant

    Hi @ukai-themes

    That works perfectly, thanks a lot!! Also, how could I add the age to the user profile page?

    @imborx

    Participant

    @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

    @ukai-themes

    Participant

    Hello,

    Here’s i created this new snippet to make able to achieve that :

    https://gist.github.com/KaineLabs/e56d80b52f081a3a28e6f8e41c3b3d4c

    Good Luck.

    @imborx

    Participant

    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.

    @ukai-themes

    Participant

    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.

    @imborx

    Participant

    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!!

    @imborx

    Participant

    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:

    This is what I'm trying to do

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar