Archive for May, 2008

h1Adding New Default Gravatars To WordPress 2.6

Posted on Thursday, May 22nd, 2008 at 7:00 PM (7 months, 2 weeks ago)

Gravatar support was added into the WordPress core in 2.5. You could toggle them and chose what rating level (G/PG/PG13/R/X) you wanted to allow, but you couldn’t easily change the default avatar for users without a custom Gravatar. That is, until recently.

Earlier this month, Ryan committed a modified version of a patch I wrote. It adds a list of default avatars to the bottom of the discussion options page and has already been added to WordPress.com.

What does this mean for theme developers? Well, this new feature also allows you to define custom default avatars that better match your theme. Here is some example code that you would add to your theme’s functions.php:

<?php

add_filter( 'avatar_defaults', 'mytheme_addgravatar' );

function mytheme_addgravatar( $avatar_defaults ) {
	$myavatar = get_bloginfo('stylesheet_directory') . '/images/avatar.png';
	$avatar_defaults[$myavatar] = 'My Theme';
	return $avatar_defaults;
}

?>

That will add a new default avatar option to the bottom of the user’s settings page.

h1Clean Archives Reloaded v3.0.0

Posted on Saturday, May 10th, 2008 at 10:03 PM (8 months ago)

For those that haven’t noticed, I released a new version of Clean Archives Reloaded yesterday. It’s a major reworking of the plugin and it now requires WordPress 2.5 (due to functions it uses).

It’s now faster than before (I saw page generation times drop by about 10% on my test blog), an options page to configure the plugin, and much, much more.

So, upgrade today! :)

#