Custom Avatar Shortcode
-
I’m using the following shortcode to pull in user avatars for a front-end dashboard page in conjunction with WP User Avatar. I’ve set a new avatar for myself on my profile page, yet I’m still seeing the default Mystery Man on the page using my shortcode.
Are there any issues/conflicts between the shortcode/plugin that would stop the custom avatar being displayed? I’m not sure why it wouldn’t pull in my custom avatar?
// User Avatar add_shortcode( 'current-avatar' , 'ss_get_current_avatar' ); function ss_get_current_avatar(){ $user = wp_get_current_user(); echo get_avatar( $id_or_email, $size, $default, $alt ); } // Add class to avatar add_filter('get_avatar','add_gravatar_class'); function add_gravatar_class($class) { $class = str_replace("class='avatar", "class='avatar welcome_avatar", $class); return $class; }Thanks for your help!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Custom Avatar Shortcode’ is closed to new replies.