Skip to content

Instantly share code, notes, and snippets.

@remkus
Forked from wpsmith/author_box_filter.php
Created May 2, 2012 13:16
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 remkus/2576468 to your computer and use it in GitHub Desktop.
Save remkus/2576468 to your computer and use it in GitHub Desktop.
Filter Author Box
<?php
add_filter( 'genesis_author_box', 'zip_author_box', 10, 6 );
/**
* Filters author box by adding extra link
*
* @access public
* @param mixed $output
* @param mixed $context
* @param mixed $pattern
* @param mixed $gravatar
* @param mixed $title
* @param mixed $description
* @return void
*/
function zip_author_box( $output, $context, $pattern, $gravatar, $title, $description ) {
$pattern = $context == 'single' ? '<div class="author-box"><div>%s %s<br />%s<br />%s</div></div><!-- end .authorbox-->' : '<div class="author-box">%s<h1>%s</h1><div>%s<br />%s</div></div><!-- end .authorbox-->';
$link = '<span class="author vcard"><a href="'. get_author_posts_url( get_the_author_meta( 'ID' ) ).'">'. get_the_author_meta( 'display_name' ).' </a></span>'; //HTML Markup
return sprintf( $pattern, $gravatar, $title, $description, $link );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment