Get only the author profile picture image url inside a loop

Putting the following inside loop should fulfill your needs: <?php $get_author_id = get_the_author_meta(‘ID’); $get_author_gravatar = get_avatar_url($get_author_id, array(‘size’ => 450)); if(has_post_thumbnail()){ the_post_thumbnail(); } else { echo ‘<img src=”‘.$get_author_gravatar.'” alt=”‘.get_the_title().'” />’; } ?>

Replace default avatar

I figured this out. The server I am working on doesn’t have access to the outside. So, even though the image is in my template folder, the gravatar.com call in front of the image path was causing the error.

How to get gravatar url alone

Just generate the URL yourself. It’s just a hash of the user’s email address. function get_gravatar_url( $email ) { $hash = md5( strtolower( trim ( $email ) ) ); return ‘http://gravatar.com/avatar/’ . $hash; } This function requires that you pass the user’s email address in … but you could do anything you need to programatically … Read more

Rectangle avatars

As far as I know the get_avatar() function only allows for square values. That doesn’t mean you couldn’t use styling to display a rectangular avatar. Essentially you would use styling to “shave off” 150px from the width. So, let’s assume that your theme file produces a 300 x 300 pixel avatar for the post author … Read more

Wrong gravatar showing up?

If you go to http://gravatar.com/d6b10d5767d1e29006c11e1a2c590f3c (omit the /avatar/ from path) you get http://gravatar.com/clojita which seems to be your gravatar account, correct? MD5 collision is unlikely (but maybe it’s time to buy a lottery ticket 🙂 Look at source fetches interesting detail — the comment in question has comment-author-clark class. So it’s not only the gravatar … Read more

How to override Member’s Avatars in BuddyPress [closed]

The filters you cite are only for the default/fallback avatars. If you want to replace BP avatars altogether, the key filters are bp_core_fetch_avatar and bp_core_fetch_avatar_url. The latter filters the entire HTML avatar element, while the latter does just the URL. How you do the filtering depends on how fancy you want to get. The bp_core_fetch_avatar … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)