Skip to content

Instantly share code, notes, and snippets.

@paultibbetts
Forked from pfefferle/blavatars.php
Created August 28, 2014 21:29
Show Gist options
  • Save paultibbetts/66259c06bc9485cc4268 to your computer and use it in GitHub Desktop.
Save paultibbetts/66259c06bc9485cc4268 to your computer and use it in GitHub Desktop.
<?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 "//www.gravatar.com/avatar/" .
md5(strtolower(get_bloginfo("admin_email"))) . "?s=" . $size;
}
@paultibbetts
Copy link
Author

Removed the http: from line 28, Firefox was complaining of insecure images now I've got https set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment