Created
July 15, 2017 13:42
-
-
Save manhleo93/6935bd5143aa5b06afcc1a88363f14c9 to your computer and use it in GitHub Desktop.
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
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8); | |
add_action('genesis_after_entry', 'theme_author_box', 8); | |
function theme_author_box() { | |
$authinfo = "<div class=\"postauthor\">\r\n"; | |
$authinfo .= get_avatar(get_the_author_id() , 100); | |
$authinfo .= "<h4>". get_the_author_meta('display_name') ."</h4>\r\n"; | |
$authinfo .= "<p>" . get_the_author_meta('description') . "</p>\r\n"; | |
$authinfo .= "</div>\r\n"; | |
$facebook = get_the_author_meta('facebook'); | |
$twitter = get_the_author_meta('twitter'); | |
$gplus = get_the_author_meta('gplus'); | |
$blog_title = get_the_author_meta('blog_title'); | |
$flength = strlen($facebook); | |
$tlength = strlen($twitter); | |
$glength = strlen($gplus); | |
$llength = strlen($blog_title); | |
$authsocial = "<div class=\"postauthor-bottom\"> <p><span>Connect With Me :</span>\r\n"; | |
if ($flength > 1) { | |
$authsocial .= "<a class=\"author-fb\" href=\"http://facebook.com/" . $facebook . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " on Facebook\">Facebook</a>"; | |
} | |
if ($glength > 1) { | |
$authsocial .="<a class=\"author-gplus\" href=\"" . $gplus . "\" rel=\"me\" target=\"_blank\" title=\"" . get_the_author_meta('display_name') . " on Google+\">Google+</a>"; | |
} | |
if ($tlength > 1) { | |
$authsocial .= "<a class=\"author-twitter\" href=\"http://twitter.com/" . $twitter . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " on Twitter\">Twitter</a>"; | |
} | |
if ($llength > 1) { | |
$authsocial .= "<a class=\"author-blog\" href=\"" . $blog_title . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " Personal Blog\">Personal Blog</a>"; | |
} | |
$authsocial .= "</p>\r\n"; | |
$authsocial .= "</div>\r\n"; | |
if ( is_single() ) { | |
echo $authinfo; | |
echo $authsocial; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment