Created
February 2, 2012 16:35
-
-
Save pfefferle/1724438 to your computer and use it in GitHub Desktop.
Blog Avatar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Blavatars | |
Plugin URI: https://gist.github.com/1724438 | |
Description: Use Gravatar as a blogs avatar (Web Clip, Favicon, ...) | |
Version: 0.1 | |
Author: Matthias Pfefferle | |
Author URI: http://notizblog.org/ | |
*/ | |
add_action('wp_head', 'blavatar_header'); | |
function blavatar_header() { | |
?> | |
<link rel="apple-touch-icon" href="<?php get_blavatar(57); ?>" /> | |
<link rel="apple-touch-icon" sizes="72x72" href="<?php get_blavatar(72); ?>" /> | |
<link rel="apple-touch-icon" sizes="114x114" href="<?php get_blavatar(114); ?>" /> | |
<link rel="icon favicon shortcut" sizes="16x16" href="<?php get_blavatar(16); ?>" /> | |
<?php | |
} | |
function get_blavatar($size = 90) { | |
echo get_the_blavatar($size); | |
} | |
function get_the_blavatar($size = 90) { | |
return "http://www.gravatar.com/avatar/" . | |
md5(strtolower(get_bloginfo("admin_email"))) . "?s=" . $size; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment