<?php
//Get the Author image by Digital Raindrops
function dr_author_header() {
$style="";
if ( is_page() || is_single() ) {
$authorid = $post[0]->post_author;
$slug = the_author_meta('user_nicename', $authorid );
if ( file_exists( get_template_directory_uri() .'/images/'.$slug.'.png' ) ) {
$link = the_author_meta( 'user_url', $authorid );
//Get author image by and the author url
$style = ' style="background-image: url(' .get_template_directory_uri() .'/images/'.$slug.'.png);" ';
$style = $style .' onclick="location.href='.$link.'" ';
}
}
return $style;
}
?>
<?php
//See if we want to swap the header banner and add a link
$style=dr_author_header();
?>
<div class="header-png"<?php echo $style; ?>></div>