Author: Chip Bennett

  • Twitter Updates for 2010-10-04

    • @mattwiebe dude, you know we do actually *read* the PHP comments in Themes, right? #
  • Twitter Updates for 2010-10-03

  • Twitter Updates for 2010-10-02

  • Twitter Updates for 2010-10-01

  • Twitter Updates for 2010-09-29

  • Twitter Updates for 2010-09-28

  • Twitter Updates for 2010-09-27

    • Unfortunately, I'm not going to have many comments on the #Colts game today. We're stuck watching WAS-STL. #
    • Thank you, Kyle Orton! Lacey just had the #Colts #039; longest YAC of the game so far! #
    • Touchdown! Manning to Collie! #Colts have turned 2 DEN turnovers into 10 points, and lead 13-0. #
    • @Shake1n1bake so why don't get get out of zone? All of our CBs are healthy, as is our line. in reply to Shake1n1bake #
    • @Shake1n1bake man coverage, scary? This is Orton to Royal/Gaffney; not Brady to Moss/Welker! I think Hayden, Powers, and Lacey can handle in reply to Shake1n1bake #
    • Since when did a horse-collar constitute grabbing the jersey, but not get a hand inside the pads? Bad call in #WAS #STL game. #
    • @Shake1n1bake I was just going to ask if you wanted to reconsider… in reply to Shake1n1bake #
    • @Shake1n1bake once, early. I don't remember that game ending up close. Might as well have Tim Jennings on the field with this zone. in reply to Shake1n1bake #
    • @18to88 more to blame are giving up the long pass plays, and allowing third-down conversions. in reply to 18to88 #
    • Hey #NFL any chance your officials could just – for once – call one of the ridiculously blatant holds of Freeney? Your officials suck. #
    • @Shake1n1bake and what was it this time? I am without the benefit of actually getting to watch the game this week. in reply to Shake1n1bake #
    • Peyton Manning: 3 games, 1000yds, 9TDs, 0 INTs. Just go ahead and mail in the MVP votes ahead of time. Go #Colts #
    • Ballgame. #Colts win! Three fourth-down stops for our Defense today! #
    • How often does this happen: top 2 QBs (by yardage) – Orton (DEN) and Rivers (SD) – both had over 400yds today, and both lost. #
    • @wptavern unless I have a *really* good reason not to, I generally take _ck_'s word on anything bbPress-related. in reply to wptavern #
    • @markmcwilliams @wptavern personally? I don't know his motives, and don't care. Motives aren't as important as the end result. in reply to markmcwilliams #
    • @markmcwilliams @wptavern I don't think _ck_ was implying *improper* or *ulterior* motives, just clarifying her inference of his priorities in reply to markmcwilliams #
    • @markmcwilliams @wptavern is she right that BP is higher priority than bbP? Maybe. But if bbPress-as-plugin ends up being awesome? I'm happy in reply to markmcwilliams #
    • I wonder what Freeney and Mathis think when they see the ticky-tack crap that gets called as Offensive Holding for *other* teams. #
    • @18to88 that might possibly be the worst DPI call I've ever seen. in reply to 18to88 #
    • Dear #NFL your officials could at least *try* not to make it so obvious that they want the Jets to win this game. This is terrible. #
  • Twitter Updates for 2010-09-26

  • Custom WordPress Gravatars – The Right Way

    I recently (h/t: Nacin) came across this tutorial by Nenuno Creative that recommends bypassing WordPress core implementation of Gravatars in order to output custom Gravatars. Below, I present a brief tutorial for a much better way to implement custom Gravatars in a way that doesn’t require bypassing WordPress’ core functionality.

    The Nenuno Creative tutorial presents the following “customizations” of Gravatars:

    1. Comment Author email address
    2. Custom default Gravatar image
    3. Custom Gravatar image size

    The problem with their tutorial is that, assuming your Theme is using wp_list_comments() to output the comments list (and your Theme is using wp_list_comments() to output the comments list, isn’t it?), you have no easy way to control where and how your custom-built Gravatar is displayed (at least, not without quite a bit of additional custom code) – as evinced by the author’s recommendation:

    I would recommend using this in the “comments.php” page, somewhere around “< ? php wp_list_comments(); ? >” or whatever similar you may have in your theme!

    Not a terribly helpful implementation suggestion, is it? (And in truth, since wp_list_comments() outputs a Gravatar by default, it’s actually a rather incorrect recommendation.) Fortunately, all of the above can be implemented in a much, much easier way.

    First, wp_list_comments() by default outputs a 32x32px Gravatar based on the Comment Author email address. So, all we need to deal with are custom Gravatar size, and custom default Gravatar image.

    Custom Gravatar size is as simple as passing the avatar_size argument to wp_list_comments(). The arguments passed to wp_list_comments() are an array, so to output an 80x80px Gravatar, replace the default call:

    wp_list_comments();

    With this:

    wp_list_comments( ‘avatar_size=80’ );

    Simple, right?

    That just leaves us with defining a custom default Gravatar image. Admittedly, this part is a bit trickier, but still not terribly complicated. We will be using the built-in user-configuration setting for default Gravatar image. By default, the option list includes “Mystery Man”, “blank” (no image), the Gravatar logo, an Identicon, a Wavatar, and a Monster ID:

    Default Avatars
    The default list of images available for use as the default avatar in WordPress, including Mystery Man, blank (no image), the Gravatar logo, Identicon, Wavatar, and Monster ID

    We will be hooking into this list, using the avatar_defaults filter, in order to add a custom image to this list (h/t: WPEngineer).

    Simply add the following to your Theme’s functions.php file:

    function mytheme_addgravatar( $avatar_defaults ) {
      $myavatar = get_bloginfo('template_directory') . '/images/avatar.gif';
      $avatar_defaults[$myavatar] = 'My Theme Custom Gravatar';
    
      return $avatar_defaults;
    }
    add_filter( 'avatar_defaults', 'mytheme_addgravatar' );

    You will need to replace /images/avatar.gif with an appropriate image file, that you have uploaded to your Theme directory.

    That’s it! Now, just go to Settings -> Discussion, and you will see your custom image listed in the options for Default Avatar:

    Default Avatar Setting List With Custom Image
    The default avatar setting list with a custom image "My Theme Custom Gravatar" added to the list

    Simply select your custom image, and save settings.

    Voila! We’ve just implemented everything from the Nenuno Creative tutorial, in a way that uses, rather than bypasses, core WordPress functionality.

  • Twitter Updates for 2010-09-25