forked from mirror/_s
_s: Add basic custom logo support
See: https://codex.wordpress.org/Theme_Logo Closes #922
This commit is contained in:
parent
f756b98df3
commit
2bef512355
|
@ -67,6 +67,18 @@ function _s_setup() {
|
||||||
|
|
||||||
// Add theme support for selective refresh for widgets.
|
// Add theme support for selective refresh for widgets.
|
||||||
add_theme_support( 'customize-selective-refresh-widgets' );
|
add_theme_support( 'customize-selective-refresh-widgets' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add support for core custom logo.
|
||||||
|
*
|
||||||
|
* @link https://codex.wordpress.org/Theme_Logo
|
||||||
|
*/
|
||||||
|
add_theme_support( 'custom-logo', array(
|
||||||
|
'height' => 250,
|
||||||
|
'width' => 250,
|
||||||
|
'flex-width' => true,
|
||||||
|
'flex-height' => true,
|
||||||
|
) );
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
add_action( 'after_setup_theme', '_s_setup' );
|
add_action( 'after_setup_theme', '_s_setup' );
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
<header id="masthead" class="site-header">
|
<header id="masthead" class="site-header">
|
||||||
<div class="site-branding">
|
<div class="site-branding">
|
||||||
<?php
|
<?php
|
||||||
|
the_custom_logo();
|
||||||
if ( is_front_page() && is_home() ) : ?>
|
if ( is_front_page() && is_home() ) : ?>
|
||||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
|
|
@ -14,6 +14,11 @@ object {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure logo link wraps around logo image. */
|
||||||
|
.custom-logo-link{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------
|
/*--------------------------------------------------------------
|
||||||
## Captions
|
## Captions
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
|
|
|
@ -817,6 +817,11 @@ object {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure logo link wraps around logo image. */
|
||||||
|
.custom-logo-link{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------
|
/*--------------------------------------------------------------
|
||||||
## Captions
|
## Captions
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
|
|
Reference in New Issue