Skip to content

Instantly share code, notes, and snippets.

@reasonstousegenesis
Created October 14, 2015 00:14
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 reasonstousegenesis/9f88d7e681c7d6e9897b to your computer and use it in GitHub Desktop.
Save reasonstousegenesis/9f88d7e681c7d6e9897b to your computer and use it in GitHub Desktop.
Edit the output of the author box with Genesis (advanced version)
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Edit the output of the author box with Genesis (advanced version)
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/author-box-filter/
*/
add_filter( 'genesis_author_box', 'rtug_author_box_advanced', 10, 6 );
function rtug_author_box_advanced( $output, $context, $pattern, $gravatar, $title, $description ) {
// no author box if no biographical info
if ( ! $description )
return '';
// add a class
if ( 'single' === $context )
$output = str_replace( 'class="author-box"', 'class="author-box content-box-yellow"', $output );
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment