Created
October 14, 2015 00:14
-
-
Save reasonstousegenesis/9f88d7e681c7d6e9897b to your computer and use it in GitHub Desktop.
Edit the output of the author box with Genesis (advanced version)
This file contains 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 | |
// 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