Skip to content

Instantly share code, notes, and snippets.

@vladutilie
Last active November 27, 2018 15:37
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 vladutilie/60563961882cc728395e398048df228a to your computer and use it in GitHub Desktop.
Save vladutilie/60563961882cc728395e398048df228a to your computer and use it in GitHub Desktop.
Custom logo for WP Dentist, WordPress theme: replace h1 tag from wp-dentist/inc/functions/template-hooks.php with this one
<h1 id="logo">
<?php
$custom_logo_id = get_theme_mod( 'custom_logo' );
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
if ( has_custom_logo() ) {
echo '<a href="'. esc_url( home_url( '/' ) ) .'" title="'. esc_attr( get_bloginfo( 'name', 'display' ) ) .'" rel="home"><img src="'. esc_url( $logo[0] ) .'"></a>';
} else {
echo '<a class="navbar-brand" href="'. esc_url( home_url( '/' ) ) .'" title="'. esc_attr( get_bloginfo( 'name', 'display' ) ) .'" rel="home">'. esc_html( bloginfo('name') ) .'</a>';
}
?>
</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment