<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Justin Tadlock &#187; Gravatars</title>
	<atom:link href="http://justintadlock.com/tags/gravatars/feed" rel="self" type="application/rss+xml" />
	<link>http://justintadlock.com</link>
	<description>Life, Blogging, and WordPress</description>
	<lastBuildDate>Fri, 11 May 2012 00:27:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Doing more with gravatars: Authors template page</title>
		<link>http://justintadlock.com/archives/2008/06/09/doing-more-with-gravatars-authors-template-page</link>
		<comments>http://justintadlock.com/archives/2008/06/09/doing-more-with-gravatars-authors-template-page#comments</comments>
		<pubDate>Mon, 09 Jun 2008 20:38:51 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Gravatars]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=915</guid>
		<description><![CDATA[We&#8217;ve learned how to add an author bio to single posts and revamp our comments with gravatars. Now, it&#8217;s time to take this one step farther. We&#8217;re going to create a template page for all of our authors. This can be useful if you have multiple authors on your site and want to have a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://justintadlock.com/blog/wp-content/uploads/2008/06/authors-template-page.gif" title="Creating an authors template page with WordPress" alt="Creating a WordPress authors template page" /></p>
<p>We&#8217;ve learned how to <a href="http://justintadlock.com/archives/2008/05/05/doing-more-with-gravatars-part-2" title="Adding an author bio to WordPress single posts"> add an author bio</a> to single posts and <a href="http://justintadlock.com/archives/2008/04/30/doing-more-with-gravatars-part-1" title="Making your WordPress comments section gravatar-ready"> revamp our comments</a> with gravatars.  Now, it&#8217;s time to take this one step farther.</p>
<p>We&#8217;re going to create a template page for all of our authors.</p>
<p>This can be useful if you have multiple authors on your site and want to have a page that lists all of them.  It&#8217;ll let users get to know each author a little before diving into their posts.</p>
<p><strong>Note to my theme users:</strong> Of course, all of this stuff is being built right into the development versions of my themes.  So, you can look forward to some of this stuff being added in future updates.</p>
<p>Here are the steps required in doing this:</p>
<ol>
<li>Give your authors some biographical information from your WordPress dashboard.</li>
<li>Create a template page to display each author.</li>
<li>Write a new Page and save it with your new template.</li>
</ol>
<p>Oh, and you might want to get a <a href="http://gravatar.com" title="Gravatar"> gravatar</a> if you don&#8217;t have one.</p>
<h3>Setting up your authors biographical information</h3>
<p>Well, there&#8217;s no use in having an authors page without showing some biographical information along with each author.</p>
<p>Log into your WordPress dashboard and click on the &#8220;Users&#8221; link.  From there, you can select any user you want to add information for.  Scroll down to the bottom of the screen, and you&#8217;ll see a section named &#8220;Biographical Info.&#8221;  Just type whatever you want about yourself or a particular author.</p>
<p><img src="http://justintadlock.com/blog/wp-content/uploads/2008/05/wordpress-about.gif" alt="Writing author bios in the WordPress dashboard" title="Writing an author bio in the WordPress dashboard" /></p>
<p>Click &#8220;Update Profile&#8221; to save this new information.  You&#8217;ll probably want each author of your blog to write a short blurb that suits them.</p>
<h3>Creating the authors template</h3>
<p>The first thing we need to do is name our template (very important!) and get the header file.  I&#8217;ve named this template &#8220;Authors&#8221; for simplicity.</p>
<pre><code>&lt;?php /*
Template Name: Authors
*/ ?&gt;

&lt;?php get_header(); ?&gt;</code></pre>
<p>Then, we need to set up a basic loop to show the title and content of the page.  This way, you can still write a little describing the page later.</p>
<pre><code>&lt;?php if(have_posts()) : while(have_posts()) : the_post(); ?&gt;

	&lt;div class="post"&gt;
		&lt;h2 class="section-header"&gt;
			&lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
		&lt;/h2&gt;
		&lt;div class="entry"&gt;
			&lt;?php the_content(); ?&gt;
		&lt;/div&gt;
	&lt;/div&gt;

&lt;?php endwhile; endif; ?&gt;</code></pre>
<p>Now, we can move on to the backbone of this template page, which will show all of our author profiles.</p>
<p>Before we display any information, we need to actually grab the information from the database.  I tried to comment this well enough for everyone to reasonably understand what&#8217;s going on.</p>
<pre><code>&lt;?php

// Get the authors from the database ordered by user nicename
	global $wpdb;
	$query = "SELECT ID, user_nicename from $wpdb-&gt;users ORDER BY user_nicename";
	$author_ids = $wpdb-&gt;get_results($query);

// Loop through each author
	foreach($author_ids as $author) :

	// Get user data
		$curauth = get_userdata($author-&gt;ID);

	// If user level is above 0 or login name is "admin", display profile
		if($curauth-&gt;user_level &gt; 0 || $curauth-&gt;user_login == 'admin') :

		// Get link to author page
			$user_link = get_author_posts_url($curauth-&gt;ID);

		// Set default avatar (values = default, wavatar, identicon, monsterid)
			$avatar = 'wavatar';
?&gt;</code></pre>
<p>Now for the actual display of the author profiles.  We&#8217;ll just show each author&#8217;s gravatar, display name, and description with the gravatar and display name linked to the author&#8217;s archive page.</p>
<p>I&#8217;m treating each profile as a post, so I won&#8217;t have to add additional CSS to my stylesheet to get them to display properly.</p>
<pre><code>&lt;div class="post"&gt;

	&lt;a href="&lt;?php echo $user_link; ?&gt;" title="&lt;?php echo $curauth-&gt;display_name; ?&gt;"&gt;
		&lt;?php echo get_avatar($curauth-&gt;user_email, '96', $avatar); ?&gt;
	&lt;/a&gt;

	&lt;h3 class="post-title"&gt;
		&lt;a href="&lt;?php echo $user_link; ?&gt;" title="&lt;?php echo $curauth-&gt;display_name; ?&gt;"&gt;&lt;?php echo $curauth-&gt;display_name; ?&gt;&lt;/a&gt;
	&lt;/h3&gt;

	&lt;p&gt;
		&lt;?php echo $curauth-&gt;description; ?&gt;
	&lt;/p&gt;

&lt;/div&gt;</code></pre>
<p>After that, we just need to close off everything we&#8217;ve opened.</p>
<pre><code>		&lt;?php endif; ?&gt;

	&lt;?php endforeach; ?&gt;

&lt;?php get_footer(); ?&gt;</code></pre>
<p>Just save this file as &#8220;authors.php&#8221; and drop it in the folder of the theme you&#8217;re currently using.  You have to save this before moving on to the next step.</p>
<h3>Writing our authors page</h3>
<p>Once the above is done, all we have to do is create a new page.  We go back into our WordPress dashboard and click on &#8220;Write > Page&#8221; to do this.</p>
<p>Give your new page a title; something like &#8220;Authors&#8221; might work.  Maybe write a few sentences describing what this page is for.</p>
<p>For the most important part (you can&#8217;t forget this), find the section titled &#8220;Page Template.&#8221;  There&#8217;ll be a drop-down list of page templates to choose from.  Select the &#8220;Authors&#8221; template.</p>
<p><img src="http://justintadlock.com/blog/wp-content/uploads/2008/06/authors-template.gif" title="Selecting the Authors template from your WordPress Write Page panel" alt="Selecting the Authors template from your WordPress Write Page panel" /></p>
<p>Once that&#8217;s done, you can publish your new page and view it on the Web.</p>
<h3>Other things you can display</h3>
<p>There are a few other things you can display as well.  For example, you might want to give a link back to the author&#8217;s personal website or show their email.  From the <a href="http://codex.wordpress.org/Author_Templates" title="WordPress author templates"> author templates</a> page in the WordPress Codex, there&#8217;s a list of things you can show (I&#8217;m sure they don&#8217;t mind me borrowing them for this post).</p>
<p>These things are all configurable from the user profile edit page.  Just make sure you use them after the line:</p>
<pre><code>$curauth = get_userdata($author);</code></pre>
<p>from the above code.</p>
<pre><code>$curauth-&gt;aim;
$curauth-&gt;description;
$curauth-&gt;display_name;
$curauth-&gt;first_name;
$curauth-&gt;ID;
$curauth-&gt;jabber;
$curauth-&gt;last_name;
$curauth-&gt;nickname;
$curauth-&gt;user_email;
$curauth-&gt;user_login;
$curauth-&gt;user_nicename;
$curauth-&gt;user_registered;
$curauth-&gt;user_url;
$curauth-&gt;yim;</code></pre>
<h3>Go ahead and create your authors template</h3>
<p>This should be a mandatory page for multi-author blogs.  It will let your users get to know each author a little better.</p>
<p>As mentioned earlier, I will be incorporating this template into my themes, so if you&#8217;re using one of them, look forward to this feature in the next update.</p>
<p>If you need help implementing this, just stop by the <a href="http://justintadlock.com/forums" title="Support forums"> support forums</a> because it&#8217;s much easier to post code there.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2008/06/09/doing-more-with-gravatars-authors-template-page/feed</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>Doing more with gravatars: Part 2</title>
		<link>http://justintadlock.com/archives/2008/05/05/doing-more-with-gravatars-part-2</link>
		<comments>http://justintadlock.com/archives/2008/05/05/doing-more-with-gravatars-part-2#comments</comments>
		<pubDate>Mon, 05 May 2008 19:20:30 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Gravatars]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=852</guid>
		<description><![CDATA[We've learned how to <a href="http://justintadlock.com/archives/2008/04/30/doing-more-with-gravatars-part-1" title="Doing more with WordPress gravatars: Part 1"> spruce up our comments sections</a> a bit with the first part of this series.  Now, we'll cover an about the author section for single posts.

I think this will mostly be useful for blogs and sites with multiple authors because you might want to tell more about who is writing the post.]]></description>
			<content:encoded><![CDATA[<p><img src="http://justintadlock.com/blog/wp-content/uploads/2008/05/gravatars-wordpress.gif" alt="Using WordPress gravatars for an about me section" title="Using WordPress gravatars for an about me section" class="center" /></p>
<p>We&#8217;ve learned how to <a href="http://justintadlock.com/archives/2008/04/30/doing-more-with-gravatars-part-1" title="Doing more with WordPress gravatars: Part 1"> spruce up our comments sections</a> a bit with the first part of this series.  Now, we&#8217;ll cover an about the author section for single posts.</p>
<p>I think this will mostly be useful for blogs and sites with multiple authors because you might want to tell more about who is writing the post.</p>
<p>The &#8220;About the Author&#8221; section is generally a short blurb about the author of the post that you&#8217;ll see at the end of posts of multi-author blogs.  This is a way to show a little bit of the personality of the writer and connect with readers more.</p>
<p>Of course, I&#8217;m assuming that you either have a <a href="http://gravatar.com" title="Get your gravatar"> gravatar</a> or know what one is.</p>
<h3>Here&#8217;s what we&#8217;ll cover</h3>
<p>First, I&#8217;ll show you how to put together a very basic &#8220;About the Author&#8221; section on your single posts using some of the same techniques from the first tutorial.</p>
<p>Then, I&#8217;ll show you some extra things you can do for personal gravatars that are unique to your site.</p>
<h3>Writing your about section</h3>
<p>The first thing you need to do (aside from getting a gravatar) is writing your about section.</p>
<p>In your WordPress dashboard, click on the link that says &#8220;Users.&#8221;  You&#8217;ll see a list of all the users for your blog.  You can either click &#8220;Your Profile&#8221; at the top or find a specific user from the list that you want to edit.  On the next screen, scroll down the page and look for a section titled &#8220;Biographical Info.&#8221;  This is where you&#8217;ll write your short blurb.</p>
<p><img src="http://justintadlock.com/blog/wp-content/uploads/2008/05/wordpress-about.gif" alt="Writing your WordPress about section" title="Writing your WordPress about section" class="center" /></p>
<p>Once that&#8217;s done, click &#8220;Update Profile.&#8221;</p>
<h3>The basic &#8220;About the Author&#8221; section</h3>
<p>Now, you need to open the file <code> single.php</code> in your current theme folder.  All themes are a bit different, so I can&#8217;t tell you exactly where to put it, but it should be after your post content and before <code> comments_template();</code></p>
<p>Here&#8217;s the easiest code possible you could put in that area:</p>
<pre><code>&lt;div id="author-box" class="section"&gt;
	&lt;h3 class="section-header"&gt;&lt;?php _e('About the author'); ?&gt;&lt;/h3&gt;
&lt;?php
	$author_email = get_the_author_email();
	echo get_avatar($author_email, '80', 'wavatar');
?&gt;
	&lt;h4&gt;&lt;?php the_author_posts_link(); ?&gt;&lt;/h4&gt;
	&lt;?php the_author_description(); ?&gt;
&lt;/div&gt;</code></pre>
<p>You can change the word &#8220;wavatar&#8221; to default, identicon, or monsterid.  See the <a href="http://blog.gravatar.com/2008/04/22/identicons-monsterids-and-wavatars-oh-my/" title="Identicons, MonsterIDs, and Wavatars"> gravatar blog post</a> to read about these options.  I just like wavatars the best.</p>
<p>Now, if the author of the blog post has a gravatar, then their personal gravatar will appear.  If not, they&#8217;ll get a funny looking character.</p>
<h3>Special avatars for authors without gravatars</h3>
<p>Maybe you don&#8217;t want to show any of the default gravatar icons for authors without gravatars.  So, we&#8217;ll just give them personal avatars for your site.</p>
<p>You&#8217;d need to upload an image with the author&#8217;s user login name to a folder called &#8220;images&#8221; in your theme.  For example, if you had a user with a login name of &#8220;mohawk,&#8221; you&#8217;d give him an image of <code> mohawk.jpg</code>.  Of course, you could alter these things to suit your needs.</p>
<p>This only requires a couple extra lines of code and a small change:</p>
<pre><code>&lt;div id="author-box" class="section"&gt;
	&lt;h3 class="section-header"&gt;&lt;?php _e('About the author'); ?&gt;&lt;/h3&gt;
&lt;?php
	$author_email = get_the_author_email();
	$author_login = get_the_author_login();
	$avatar = get_bloginfo(stylesheet_directory) . '/images/' . $author_login . '.jpg';
	echo get_avatar($author_email, '80', $avatar);
?&gt;
	&lt;h4&gt;&lt;?php the_author_posts_link(); ?&gt;&lt;/h4&gt;
	&lt;?php the_author_description(); ?&gt;
&lt;/div&gt;</code></pre>
<p>If this doesn&#8217;t seem to work correctly, try using <code> get_the_author_id();</code> instead of <code> get_the_author_login();</code>.  Then, you&#8217;d need to change the names of the images to the IDs of your authors.</p>
<h3>Giving everyone personal avatars</h3>
<p>Let&#8217;s presuppose that you don&#8217;t want to use the Gravatar service for this at all.  You might still want to add user avatars for your site and host your own images.  Using the techique from the last section, placing individual images for each author in the &#8220;images&#8221; folder, here&#8217;s how you&#8217;d do that.</p>
<pre><code>&lt;div id="author-box" class="section"&gt;
	&lt;h3 class="section-header"&gt;&lt;?php _e('About the author'); ?&gt;&lt;/h3&gt;
&lt;?php
	$author_login = get_the_author_login();
	$avatar = get_bloginfo(stylesheet_directory) . '/images/' . $author_login . '.jpg';
?&gt;
	&lt;img src="&lt;?php echo $avatar; ?&gt;" alt="&lt;?php echo $author_login; ?&gt;" class="avatar" /&gt;
	&lt;h4&gt;&lt;?php the_author_posts_link(); ?&gt;&lt;/h4&gt;
	&lt;?php the_author_description(); ?&gt;
&lt;/div&gt;</code></pre>
<h3>Styling this thing</h3>
<p>As with any theme, there&#8217;ll be major differences in how things are displayed.  I&#8217;ve given you an ID of &#8220;author-box&#8221; to work with.  Here&#8217;s how one might style it.  You&#8217;ll have to adjust these values to for your theme.</p>
<pre><code>#author-box {
	width: 568px;
	padding: 10px;
	background: #f7f7f7;
	border: 1px solid #eee;
	}
#author-box .avatar {
	float: left;
	width: 80px;
	height: 80px;
	}</code></pre>
<h3>More to come!</h3>
<p>Now, we have two different techniques that we can use our gravatars for.  Is there more we can do?  Yes, there is.  I&#8217;ve got at least two, possibly three, more tutorials in mind for this series.</p>
<p>So, stay tuned.  There&#8217;s more to come.</p>
<p>If you need help with this and need to post large blocks of code, try to use the <a href="http://justintadlock.com/forums" title="Support forums"> forums</a> as it&#8217;s much easier to post and read code there.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2008/05/05/doing-more-with-gravatars-part-2/feed</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Doing more with Gravatars: Part 1</title>
		<link>http://justintadlock.com/archives/2008/04/30/doing-more-with-gravatars-part-1</link>
		<comments>http://justintadlock.com/archives/2008/04/30/doing-more-with-gravatars-part-1#comments</comments>
		<pubDate>Wed, 30 Apr 2008 18:31:19 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Gravatars]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=832</guid>
		<description><![CDATA[I've been playing around quite a bit with the gravatar feature for WordPress since it now comes built in.  I've learned a few things, so I figured I'd share them with you.

From this point forward, I will assume you know what a <a href="http://en.gravatar.com" title="Gravatar"> gravatar</a> is.]]></description>
			<content:encoded><![CDATA[<p><img src="http://justintadlock.com/blog/wp-content/uploads/2008/04/wordpress-gravatars.gif" alt="WordPress gravatars in comments" title="WordPress Gravatars" class="center" /></p>
<p>I&#8217;ve been playing around quite a bit with the gravatar feature for WordPress since it now comes built in.  I&#8217;ve learned a few things, so I figured I&#8217;d share them with you.</p>
<p>From this point forward, I will assume you know what a <a href="http://en.gravatar.com" title="Gravatar"> gravatar</a> is.  WordPress 2.5 comes with <a href="http://codex.wordpress.org/Using_Gravatars" title="WordPress Codex: Using gravatars"> built-in gravatar support</a>.  If you&#8217;re using an earlier version of WordPress, you&#8217;ll need to modify the code in this tutorial and use the <a href="http://en.gravatar.com/site/implement/wordpress" title="WordPress Gravatar plugin"> gravatar plugin</a>.</p>
<p>For the first part of this series I&#8217;ll go through some techniques you could use to spruce up your comments section.  Some of you may notice that there are four distinct types of avatars used in my comments section:</p>
<ol>
<li><strong>My avatar:</strong> My personal avatar I can change from my site.</li>
<li><strong>Gravatars:</strong> User gravatars if a user has one set up.</li>
<li><strong>Wavatars / Indenticons / MonsterIDs:</strong> A gravatar that is used if a commenter doesn&#8217;t have a gravatar.</li>
<li><strong>Trackback / Pingback avatar:</strong> The avatar I use for trackbacks and pingbacks, which help separate them from normal comments.</li>
</ol>
<h3>Setting up our comments section</h3>
<p>The first thing you want to do is find your normal comment section in your theme&#8217;s <code> comments.php</code> file, which should begin something like this:</p>
<pre><code>&lt;?php
echo '&lt;ol class="commentlist"&gt;';

// Alternate comment classes (bg colors)
	$odd_comment = 'alt';

foreach ($comments as $comment) :</code></pre>
<p>For the next section, we need to set up a few variables that we&#8217;ll use later, which are the comment author&#8217;s URL, the type of comment (comment, trackback, or pingback), and include a funny-looking default avatar, which I&#8217;ve set to &#8220;wavatar.&#8221;</p>
<p>According to the <a href="http://blog.gravatar.com/2008/04/22/identicons-monsterids-and-wavatars-oh-my" title="Identicons, MonsterIDs, and Wavatars! Oh my!"> Gravatar blog</a>, there are four settings you can change your default gravatar to, which are default, identicon, monsterid, and wavatar.  I&#8217;ve chosen wavatars because I think they&#8217;re a bit more fun.</p>
<pre><code>// Set some variables that we'll use
	$commenter_url = $comment-&gt;comment_author_url;
	$comment_type = get_comment_type();
	$avatar = 'wavatar';</code></pre>
<p>Now, we need to show those comments.</p>
<pre><code>// Comments
	echo "&lt;li class='$odd_comment'&gt;";
	// Open commenter link if it exists
		if($commenter_url == true) {
			echo '&lt;a href="'.$commenter_url.'" rel="nofollow" title="'; comment_author(); echo '"&gt;';
		}</code></pre>
<p>Here&#8217;s the part where we get a little crazy with our gravatars.</p>
<p>We want to set up a default avatar just for ourselves that we can change on our on site.  This allows us to use our own avatar on our sites but our gravatar on other people&#8217;s sites.  Assuming you don&#8217;t separate trackbacks and pingbacks from the normal flow of comments, you can also give them a special avatar to distinguish them from the crowd.  If the comment is not from you, a trackback, or a pingback, then it displays normal gravatars.</p>
<p>You&#8217;ll need to change the email address and image paths in this part of the code to suit your needs.</p>
<pre><code>	// Personal avatar
		if($comment-&gt;comment_author_email == "averagejoe@mysite.com") :
			echo "&lt;img src='"; echo "/wp-content/uploads/avatar.jpg' alt='Your Name' class='avatar' /&gt;";
	// Trackback / pingback avatar
		elseif($comment_type == 'trackback' || $comment_type == 'pingback') :
			echo "&lt;img src='/wp-content/uploads/trackback.jpg' alt='Trackback/Pingback' class='avatar' /&gt;";
	// Everyone else's gravatar
		elseif($comment_type == 'comment') :
			echo get_avatar($comment-&gt;comment_author_email, '80', $avatar);
		endif;</code></pre>
<p>Now, we just need to close off the open link that wraps around the gravatar and show the rest of the normal comment section.</p>
<pre><code>	// Close commenter link if it is open
		if($commenter_url == true) echo '&lt;/a&gt;';

	// Meta data
		echo "\n&lt;div class='comment-meta-data'&gt;\n&lt;span class='comment-author'&gt;";
			comment_author_link();
		echo '&lt;/span&gt; on ';
		if($comment-&gt;comment_approved == '0') :
			echo "&lt;em&gt;Your comment is awaiting moderation.&lt;/em&gt;";
		endif;
		echo "&lt;span class='time'&gt;
			&lt;a href='#comment-"; comment_ID(); echo "' title=''&gt;"; comment_date('M jS, Y'); echo "&lt;/a&gt;";
			echo " at "; comment_time();
		echo "&lt;/span&gt;"; edit_comment_link('Edit',' &lt;span class="edit"&gt;','&lt;/span&gt; ');
		echo "\n&lt;/div&gt;";
	// Comment text
		echo "\n&lt;div class='comment-text'&gt;\n";
			comment_text();
		echo "\n&lt;/div&gt;\n";
	echo "&lt;/li&gt;\n";

// Change comment class
	if('alt' == $odd_comment) $odd_comment = 'odd';
	else $odd_comment = 'alt';

// End comment list
endforeach;
echo "&lt;/ol&gt;\n";
?&gt;</code></pre>
<h3>Styling your comments section</h3>
<p>I can&#8217;t write a one-size-fits all tutorial on this because everyone&#8217;s comment sections are styled differently.  This should get you started though.  Gravatars are given a class of <code> avatar</code>.</p>
<pre><code>#comments-template .avatar {
	float: left;
	width: 40px;
	height: 40px;
	margin: 0 15px 10px 10px;
	padding: 2px;
	background: #fff;
	border: 1px solid #ccc;
	}</code></pre>
<p>If you noticed above that I set the default avatar to <code> 80px</code> in the earlier code, that&#8217;s so that I have a lot of styling options left open later with CSS.  You can change the width and height from your stylesheet, which makes much more sense.</p>
<h3>Do more with this</h3>
<p>On my blog, I&#8217;m also using author comment highlighting, which is bit beyond the scope of this tutorial, but you can do the same.  You can also separate trackbacks and pingbacks entirely or some other crazy thing that we don&#8217;t know about yet.  </p>
<p>The whole point is to have fun with gravatars.  Let your readers show off a bit of themselves on your blog.  Get to know them a little better.</p>
<p>The code above is modified version of what I&#8217;m using on this blog, so if there are any typos, feel free to let me know.  I&#8217;ll update them ASAP.</p>
<p>Stay tuned for the rest of this tutorial series.  We&#8217;re not going to stop at the comments section.</p>
<p><strong>If you need help setting this up</strong> please stop by the <a href="http://justintadlock.com/forums" title="Support forums"> forums</a> here at my site.  It is much easier to post and read code there than in the comments section of the blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2008/04/30/doing-more-with-gravatars-part-1/feed</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>

