O'Reilly logo

WordPress MU 2.8: Beginner's Guide by Lesley A. Harrison

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - gravatars in WordPress MU

  1. Open your theme's index.php file. In our case we are editing the Blue Zinfandel theme.
  2. Find the section that begins with<div class="contentdate">.
  3. Remove all markup up to the closing</div> tag and insert the following code:
<?php $email = $authordata->user_email; $hash = md5($email); $uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=identicon&r =any&size=80'; $headers = wp_get_http_headers($uri); if (!is_array($headers)) : echo "<h3>"; echo the_time('M'); echo "</h3><h4>"; echo the_time('j'); echo "</h4>"; elseif (isset($headers["content-disposition"]) ) : echo get_avatar( $authordata->user_email, $size = '50') ; else : echo "<h3>"; echo the_time('M'); echo "</h3><h4>"; echo the_time('j'); echo "</h4>"; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required