ThemeForest

Gravatars >.<

24 posts
  • Has been a member for 3-4 years
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
wetwilly92 says

I’ve got everything working the way I’d like it, gravatar wise, except for one little thing that’s been bugging me.

I’m wonder if it is at all possible to include a file (let’s say Gravatars.png) and we wanted that to be our default image. if it possible to call that as the default without having the user upload the image and giving a direct URL ?

I’ve tried <?php gravatar( ‘default=/images/gravatar.png’ ) ; ?>

And it seems to do diddly. Normally, in a situation like this, I’d use <?php bloginfo(‘template_directory’ ) ; ?>/images/gravatar.png, but, unless I’m mistaken you can’t do the following

<?php gravatar( “http://www.”.bloginfo(‘template_directory’ ) .”/images/gravatar.png” ) ; ?>

Anyone know of a solution?,

Jordan

Edit: Ahh! Smilies everywhere!.. Added Spaces in-between “problem areas” of code.

4 years ago
352 posts
  • Has been a member for 3-4 years
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • United Kingdom
  • Referred between 50 and 99 users
danharper says

From the WordPress Codex:

<?php echo get_avatar( $comment, $size = ‘80’, $default = ‘<path_to_ur?>’ ); ?>

If that doesn’t work, try replacing $comment with $id_or_email.

4 years ago
by
by
by
by
by