Hi!
Only a question.
Did is possible display a logged user avatar in a certain page, post of part in WP by php code?
I want insert user avatar into thirdy part login widget like this:
Thank in advance.
HOW display logged user avatar in a certain page of WP
-
- User w
- Posts: 8
- Joined: Fri Jan 20, 2017 9:43 pm
- axew3
- w3all User
- Posts: 2883
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
Re: HOW display logged user avatar in a certain page of WP
yes, but it depend from where the avatar come from.
I suppose you are using the phpBB WordPress integration?
By the way if you want to display an avatar into a login widget, it isn't complicate as you just need to display avatar for the current user, so the code will look like this, just to be sure will work on any situation:
Are you using the integration plugin?
'32' is the size in px of the avatar to display.
I suppose you are using the phpBB WordPress integration?
By the way if you want to display an avatar into a login widget, it isn't complicate as you just need to display avatar for the current user, so the code will look like this, just to be sure will work on any situation:
Code: Select all
$current_user = wp_get_current_user();
echo get_avatar( $current_user->ID, 32 );
'32' is the size in px of the avatar to display.
-
- User w
- Posts: 8
- Joined: Fri Jan 20, 2017 9:43 pm
Re: HOW display logged user avatar in a certain page of WP
Sorry, I forget this info.
Yes, I use integration plugin, and in my pic you can view the results of get_avatar command: it' blank.
The phpBB avatar overwrite option in WP is actived and display avatar in WP in shift On.
Yes, I use integration plugin, and in my pic you can view the results of get_avatar command: it' blank.
The phpBB avatar overwrite option in WP is actived and display avatar in WP in shift On.
-
- User w
- Posts: 8
- Joined: Fri Jan 20, 2017 9:43 pm
Re: HOW display logged user avatar in a certain page of WP
Escuse me for double reply.
Merge, if you want.
My pieze of code is look like this:
Merge, if you want.
My pieze of code is look like this:
Code: Select all
<div class="logged-in"> <? echo get_avatar ( $id_or_email, $size = '20' ); ?> <?php echo $link_with_username;?> | <a href="<?php echo wp_logout_url( $logout_redirect_page ); ?>" title="<?php _e('Logout','login-sidebar-widget');?>"><?php _e('Logout','login-sidebar-widget');?></a></div>
- axew3
- w3all User
- Posts: 2883
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
Re: HOW display logged user avatar in a certain page of WP
are you using the integration plugin? This post moved to WordPress forum.
you need to put this where you need to output the avatar.
Code: Select all
<? echo get_avatar ( $id_or_email, $size = '20' ); ?>
-
- Posts: 1
- Joined: Wed Oct 10, 2018 11:55 am