Title: Gravatar Weirdness&#8230;same code &#8212;  different results
Last modified: August 18, 2016

---

# Gravatar Weirdness…same code — different results

 *  [nmallory](https://wordpress.org/support/users/nmallory/)
 * (@nmallory)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/gravatar-weirdnesssame-code-different-results/)
 * Hi,
 * I’m working on a design for my weight loss blog in my [sandbox](http://www.exit-23.net/wpsandbox/wordpress/).
 * I’m using the Blix theme which had gravatar code that didn’t appear to be working
   so I pulled over the code I know is working on my [personal blog](http://nmallory.exit-23.net).
 * However, it appears to be doing the default image and not picking up the comment
   author email which is definitely there.
 * `<?php if (function_exists('gravatar')) {
    if ('' != get_comment_author_url()){
   echo "<a href='$comment->comment_author_url' title='Visit $comment->comment_author'
   >"; } else { echo "<a href='http://www.gravatar.com' title='Create your own gravatar
   at gravatar.com!'>"; } echo "<img height='80' width='80' src='"; if ('' == $comment-
   >comment_type) { echo gravatar($comment->comment_author_email); } elseif ( ('
   trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)){
   echo gravatar($comment->comment_author_url); } echo "' alt='a gravatar' class
   ='gravatar' /></a>"; } ?>
 * Can someone see what’s wrong and point it out to me?

Viewing 1 replies (of 1 total)

 *  Thread Starter [nmallory](https://wordpress.org/support/users/nmallory/)
 * (@nmallory)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/gravatar-weirdnesssame-code-different-results/#post-254877)
 * OK I got it to work by taking out the comment_type check. I’m curious why it 
   works on one blog and not the other though

Viewing 1 replies (of 1 total)

The topic ‘Gravatar Weirdness…same code — different results’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [nmallory](https://wordpress.org/support/users/nmallory/)
 * Last activity: [20 years, 8 months ago](https://wordpress.org/support/topic/gravatar-weirdnesssame-code-different-results/#post-254877)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
