Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!

Merry Christmas and Happy Holidays! 🎄

wpForo 1.x.x [Solved] Can I show the name and avatar somewhere else?

7 Posts
2 Users
0 Reactions
1,366 Views
DMolina
Posts: 34
Topic starter
(@dmolina)
Trusted Member
Joined: 6 years ago

I would like to show the username with your avatar in a menu, to display the account options, is there already any function to do this?


Topic Tags
6 Replies
Robert
Posts: 10606
Admin
(@robert)
Support Team
Joined: 10 years ago

The avatar could be displayed using this function:

<?php echo get_avatar( get_current_user_id(), 60 ); ?>

The user display name:

<?php echo WPF()->current_user_display_name; ?>

5 Replies
DMolina
(@dmolina)
Joined: 6 years ago

Trusted Member
Posts: 34

@robert

Isn't there a way to use both in one function?
I want to do this, but with the functions of Wordpress I can not show the avatar of the forum profile

 


Robert
Admin
(@robert)
Joined: 10 years ago

Support Team
Posts: 10606

@dmolina

Why a function? Just put those together:

<?php echo get_avatar( get_current_user_id(), 60 ) . ' <span class="user-name">' . WPF()->current_user_display_name . '</span>' ?>

 


DMolina
(@dmolina)
Joined: 6 years ago

Trusted Member
Posts: 34

@robert

Sorry, I have not programmed for a while but I understand how to use it!
Thank you!

 


DMolina
(@dmolina)
Joined: 6 years ago

Trusted Member
Posts: 34

@robert

I think I need a little more help, this function still brings me the Wp avatar, but the one I need to show is the wpforo

<?php echo get_avatar( get_current_user_id(), 60 ); ?>

 


DMolina
(@dmolina)
Joined: 6 years ago

Trusted Member
Posts: 34

Ready, I could make it thanks!