Notifications
Clear all

Limited Support

Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.

 

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

7 Posts
2 Users
0 Reactions
1,125 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: 10616
Admin
(@robert)
Support Team
Joined: 9 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: 9 years ago

Support Team
Posts: 10616

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