Notifications
Clear all

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

7 Posts
2 Users
0 Reactions
898 Views
DMolina
Posts: 34
Topic starter
(@dmolina)
Trusted Member
Joined: 5 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: 10548
Admin
(@robert)
Support Team
Joined: 8 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: 5 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: 8 years ago

Support Team
Posts: 10548

@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: 5 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: 5 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: 5 years ago

Trusted Member
Posts: 34

Ready, I could make it thanks!