Merge pull request #73 from jessijean/master

Changes to custom logo code in header.php - Thx @jessijean for fixing that
This commit is contained in:
Holger 2016-09-20 09:57:10 +02:00 committed by GitHub
commit ea51a869fe
2 changed files with 14 additions and 2 deletions

View File

@ -47,7 +47,11 @@
</button>
<!-- Your site title as branding in the menu -->
<a class="navbar-brand" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php if ( !has_custom_logo() ) { bloginfo( 'name' ) } else { the_custom_logo() } ?></a>
<?php if (!has_custom_logo()) { ?>
<a class="navbar-brand" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php bloginfo( 'name' ); ?>
</a>
<?php } else { the_custom_logo(); } ?><!-- end custom logo -->
</div>
@ -64,7 +68,6 @@
); ?>
</div> <!-- .container -->
</nav><!-- .site-navigation -->

View File

@ -37,3 +37,12 @@ function adjust_body_class( $classes ) {
return $classes;
}
// Filter custom logo with correct classes
add_filter('get_custom_logo','change_logo_class');
function change_logo_class($html)
{
$html = str_replace('class="custom-logo"', 'class="img-responsive"', $html);
$html = str_replace('class="custom-logo-link"', 'class="navbar-brand" custom-logo-link', $html);
return $html;
}