<?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>tigtog&#039;s corner &#187; default</title>
	<atom:link href="http://www.tigtog.net/index/default/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tigtog.net</link>
	<description>webwrangling and WordPress</description>
	<lastBuildDate>Fri, 21 Oct 2011 22:07:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Customising default avatars in WordPress</title>
		<link>http://www.tigtog.net/231/customising-devault-avatars-in-wordpress/</link>
		<comments>http://www.tigtog.net/231/customising-devault-avatars-in-wordpress/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 03:01:32 +0000</pubDate>
		<dc:creator>Viv</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[2.7+]]></category>
		<category><![CDATA[avatars]]></category>
		<category><![CDATA[comments.php]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[gravatars]]></category>

		<guid isPermaLink="false">http://www.tigtog.net/?p=231</guid>
		<description><![CDATA[The problem is that WP's default Mystery Man gravatar (used when commentors have not registered an avatar for their email address at gravatar.com) is rather ubiquitous, making most WP installs look a little bit too much the same.  The other WP options for the default gravatar (autogenerated unique Identicons, Wavatars or Monsters) are not to everybody's taste, and certainly don't fit into every design concept.

The solution is to create a unique avatar just for your site, one that suits your design for a professional site or perhaps one that references an injoke at a personal blog.  Either way, it will make your site stand out. <a href="http://www.tigtog.net/231/customising-devault-avatars-in-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.tigtog.net/blog/wp-content/uploads/2010/01/nomysteryman.png" alt="" title="nomysteryman" width="140" height="138" class="alignright size-full wp-image-239" />A custom Default Avatar is an option that is built into <a href="http://themehybrid.com/">the Hybrid framework</a>, a happenstance which nudged me about my procrastination in implementing this on other <span class="domtooltips">WP<span class="domtooltips_tooltip" style="display: none">WordPress publishing platform</span></span> sites.</p>
<p>How to do it:<span id="more-231"></span></p>
<ul>
<li>
<h3>Hybrid &#038; Hybrid Child Themes</h3>
<p>Couldn&#8217;t be simpler.  Go and create your default avatar (<a href="http://www.problogdesign.com/general-tips/how-to-make-your-own-default-avatar-in-5-minutes/">a grayscale or pale monochrome version of your favicon or site logo is a good idea for &#8220;branding&#8221;</a>), go to your <span class="domtooltips">WP<span class="domtooltips_tooltip" style="display: none">WordPress publishing platform</span></span> admin Dashboard and upload it using <strong>Media &raquo; Add New</strong>, then add the full URL to the option in <strong>Appearance &raquo; Hybrid Settings</strong>.  Voila!</li>
<li>
<h3>Standard <span class="domtooltips">WP<span class="domtooltips_tooltip" style="display: none">WordPress publishing platform</span></span> themes &#8211; up to 2.7</h3>
<p>(You really should upgrade for the new security features). This solution takes only a few lines of code in the comments.php file.</p>
<pre escaped="true" lang="php" line="1"><code>
&lt;?php if(function_exists('get_avatar')) {
echo get_avatar( $comment, $size = '70', $default = '&lt;?php bloginfo('template_directory'); ?&gt;/images/gravatar.<span class="domtooltips">png<span class="domtooltips_tooltip" style="display: none">Portable Network Graphic</span></span>' );
} ?&gt;</code></pre>
</li>
<li>
<h3>Standard <span class="domtooltips">WP<span class="domtooltips_tooltip" style="display: none">WordPress publishing platform</span></span> themes &#8211; 2.7+</h3>
</li>
<p>From <span class="domtooltips">WP<span class="domtooltips_tooltip" style="display: none">WordPress publishing platform</span></span> 2.7+, the way that WordPress calls the comment-list has changed, so that the code above will not work if inserted into comments.php &#8211; there has to be code added to functions.php instead, and maybe just one little tweak to the array-call in comments.php to set the avatar size.   If you are using one of the WordPress framework systems, the code may need adjusting to call framework hooks instead of standard <span class="domtooltips">WP<span class="domtooltips_tooltip" style="display: none">WordPress publishing platform</span></span> hooks (see next section).</p>
<p><a href="http://www.kremalicious.com/2008/12/how-to-set-a-custom-gravatar-image-in-wordpress-27/">Solution Source</a>: first, add to functions.php (create it if it doesn&#8217;t already exist).  This code assumes that you have uploaded your own custom gravatar image to a folder named &#8216;images&#8217; in the <span class="domtooltips">theme<span class="domtooltips_tooltip" style="display: none">a code package that controls how a site looks through a stylesheet (may also have custom functions coding built in)</span></span> directory &#8211; if you have uploaded the image elsewhere then change the code accordingly.</p>
<pre escaped="true" lang="php" line="1">
<code>&lt;php
function my_own_gravatar( $avatar_defaults ) {
    $myavatar = get_bloginfo('template_directory') . '/images/gravatar.<span class="domtooltips">png<span class="domtooltips_tooltip" style="display: none">Portable Network Graphic</span></span>';
    $avatar_defaults[$myavatar] = 'GRAVATAR NAME DISPLAYED IN WORDPRESS';
    return $avatar_defaults;
}
add_filter( 'avatar_defaults', 'my_own_gravatar' );
?&gt;</code></pre>
<p>You should now see a new default avatar with the name you gave it in the code above added to the list (Mystery Man, Wavicon, Identicon etc) on the <strong>Settings &raquo; Discussion</strong> page.  Select it as the default and save.  Then there&#8217;s merely avatar size to consider, which is a simple array insertion into the comments.php file at the line where we see wp_list_comments :</p>
<pre escaped="true" lang="php" line="1">
<code>&lt;?php wp_list_comments(array('avatar_size'=&gt;70, )); ?&gt;</code></pre>
</li>
<li>
<h3>Thesis</h3>
<p>If you are using a WordPress frameworkyou may need to alter the above code slightly to fit with the framework architecture.  For Thesis you definitely need a slight change in the code.  There&#8217;s <a href="http://outspokenmedia.com/branding/adding-custom-default-gravatars-to-your-blog/">a good post here</a> but the code&#8217;s final line wasn&#8217;t quite right.  A quick visit to the DIYThemes forums showed me that someone had come up with a fix:</p>
<ol>
<li>Upload your custom gravatar to the Thesis custom/images folder.</li>
<li>Add the following lines to the Thesis custom_functions.php file.</li>
</ol>
<pre escaped="true" lang="php" line="1"><code>
    /* Add a Custom Default Gravatar */
    if ( !function_exists('custom_gravatar') ) {
    function custom_gravatar( $avatar_defaults ) {
    $myavatar = get_bloginfo('template_directory') . '/custom/images/IMAGENAME.<span class="domtooltips">png<span class="domtooltips_tooltip" style="display: none">Portable Network Graphic</span></span>';
    $avatar_defaults[$myavatar] = 'MYDEFAULTGRAVATARNAME';

    return $avatar_defaults;
    }
    add_filter( 'avatar_defaults', 'custom_gravatar' );
    }</code></pre>
</li>
<p>Choose the new default avatar from the <strong>Settings &raquo; Discussions</strong> page, and there you are.  Gravatar size can be tweaked as desired.
</ul>
<p>For more distinctiveness, avatars can also be customised to have different styles for authors and admins.  I&#8217;ll do a tutorial on that in the next week or so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tigtog.net/231/customising-devault-avatars-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

