Hy,
This works for me (with user-avatar plugin), list my steps:
open style your theme and add:
#user-avatar-display {
background-color: #000;
border:1px solid #454545;
-moz-border-radius: 5px;
-webkit-border-radius:5px;margin: 0 auto;
padding: 0 20px 20px;
position: absolute;
right: 250px;
text-align: center;
top: 390px;
}
#user-avatar-display-image{
border:4px solid #323232;
width:150px;
height:150px;
}
#user-avatar-link{
float:left;
margin:15px 0 15px 32px;
font-size:13px;
}
before </head>:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2"></script>
Download PrettyPhoto and call it before the closing tag </head>:
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/prettyPhoto.css" />
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.prettyPhoto.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({
theme: 'dark_square',
animationSpeed: 'fast',
opacity: 0.80,
});
});
</script>
Call User-avatar frontend:
<div id="user-avatar-display" >
<h3>Avatar</h3>
<p id="user-avatar-display-image"><?php echo get_avatar( $current_user->ID, 150);?></p>
<a id="user-avatar-link" href="<?php echo admin_url('admin-ajax.php'); ?>?action=user_avatar_add_photo&step=1&uid=<?php echo $current_user->ID; ?>?iframe=true&width=520&height=350" rel="prettyPhoto[iframes]">Cambia Avatar</a>
</div>
<script type="text/javascript">
function user_avatar_refresh_image(img){
jQuery('#user-avatar-display-image').html(img);
}
</script>
<script type='text/javascript'>
var swrAjax = {
ajaxurl: "https://your_blog.com/wp-admin/admin-ajax.php"
};
</script>
changes “your_blog.com” with the URL of your website