How to: Use MyAvatars to add some spice to your blog

No Comments
Tags: , ,
Posted 29 Oct 2007 in Geek Girl

Geek GirlMyAvatars is a WordPress plugin that helps you add some spice to your blog! Commenters can now have their photos next to their names in the comments, which leads to more interest in the comments and more clicks generated from the comments alone! From the MyAvatars website:

You can now use MyAvatars, a plugin that shows MyBlogLog’s avatars in your comments instead of Gravatar’s ones even if you’re not subscribed to MyBlogLog.com.

After installing MyAvatars to your blog’s plugins folder and activating, you have to do some tweaks to your comments code. The directions from the MyAvatars website can be kind of tricky, but read it – and then I’m going to break it down for you!

Paste the code given inside the comment’s loop (just after the “foreach ($comments as $comment) :” instruction) in your comments.php file. You can style the code for a better integration using the dedicated CSS in the plugin folder.

Call the function MyAvatars with a true for Gravatar support. E.g. MyAvatars(true);

Leave blank for default settings

Got it?!?! Good!

  1. Be sure that you have activated the plugin by going to Plugins > Plugins on your WordPress Administration screen.
  2. Now go to Presentation > Theme Editor to edit your theme.
  3. Select comments.php in the sidebar as the file you want to edit.
  4. Use CTRL-F to search for foreach ($comments as $comment) :” instruction) in your comments.php file. It may be easier for you to copy and paste the italicized portion, and paste it into the FIND box.
  5. Once you have located this code, copy and paste if(function_exists("MyAvatars"))
    MyAvatars();
    into the comments.php file, as displayed in this photo illustration, right AFTER the cursor on line 60:
    MyAvatars code
  6. Save your comments.php file, refresh your homepage and try to look at an old post with comments. You should be able to see the avatars displaying by the names of the commenters.
  7. If you want to further edit the display of the avatars, you must edit the plugin’s code itself, and I’ll post about that on WordPress Wednesday!

This special feature, Geek Girl, appears every Monday. Subscribe to the Geek Girl feed to get new installments in your feed reader.

Blog Widget by LinkWithin

Comments are closed.