Skip to content

Instantly share code, notes, and snippets.

@supercleanse
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save supercleanse/0a360b9dd14040162194 to your computer and use it in GitHub Desktop.
Save supercleanse/0a360b9dd14040162194 to your computer and use it in GitHub Desktop.
MemberPress.com's Google Authorship Customizations
<?php
// This is the code we use on MemberPress.com to customize the Genesis Author Box
// Uses the 'genesis_author_box' to add Google Authorship
add_filter('genesis_author_box', 'my_author_box_output');
function my_author_box_output( $output, $context, $pattern, $gravatar, $title, $description ) {
global $post;
if(isset($post) and $post->post_type=='post')
{
$gplus = get_the_author_meta('googleplus');
if( !empty($gplus) )
$gravatar = '<a href="'.$gplus.'?rel=author">'.$gravatar.'</a>';
return sprintf( $pattern, $gravatar, $title, $description );
}
return '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment