gareth-gillman
5/19/2016 - 1:56 PM

Default Logo for WordPress Custom Logo (since 4.5)

Default Logo for WordPress Custom Logo (since 4.5)

add_filter('get_custom_logo', 'prefix_custom_logo_default', 10);
function prefix_custom_logo_default($html){
 if(empty($html)){
  $html = '<a href="'.esc_url(site_url()).'" class="custom-logo-link" rel="home" itemprop="url">';
  $html .= '<img src="'.get_template_directory_uri() .'/images/logo.png" alt="Logo" class="custom-logo" itemprop="logo" />';
  $html .= '</a>';
 }
 return $html;
}