support for custom logo
This commit is contained in:
parent
b01ca60341
commit
e8f3b2c328
2 changed files with 11 additions and 3 deletions
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
function kit_setup() {
|
function kit_setup() {
|
||||||
|
|
||||||
add_theme_support('menus');
|
add_theme_support( 'menus' );
|
||||||
add_theme_support( 'post-thumbnails' );
|
add_theme_support( 'post-thumbnails' );
|
||||||
|
add_theme_support( 'custom-logo' );
|
||||||
|
|
||||||
register_nav_menus( array(
|
register_nav_menus( array(
|
||||||
'primary' => 'Main Menu',
|
'primary' => 'Main Menu',
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,15 @@
|
||||||
<h1 class="header-logo-container">
|
<h1 class="header-logo-container">
|
||||||
<a href="<?php echo home_url(); ?>">
|
<a href="<?php echo home_url(); ?>">
|
||||||
<span class="header-logo-text">KIT - Karlsruher Institut für Technologie</span>
|
<span class="header-logo-text">KIT - Karlsruher Institut für Technologie</span>
|
||||||
<img class="header-logo" src="<?php bloginfo('stylesheet_directory');?>/img/kit-logo.svg" alt="Logo: Karlsruher Institut für Technologie">
|
<?php if ( has_custom_logo() ) {
|
||||||
<img class="header-logo-mobile" src="<?php bloginfo('stylesheet_directory');?>/img/kit-logo-without-text.svg" alt="Logo: Karlsruher Institut für Technologie">
|
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
||||||
|
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
|
||||||
|
echo '<img class="header-logo" src="' . esc_url( $logo[0] ) . '" alt="Logo: ' . get_bloginfo( 'name' ) . '">';
|
||||||
|
echo '<img class="header-logo-mobile" src="' . esc_url( $logo[0] ) . '" alt="Logo: ' . get_bloginfo( 'name' ) . '">';
|
||||||
|
} else {
|
||||||
|
echo '<img class="header-logo" src="' . get_bloginfo('stylesheet_directory') . '/img/kit-logo.svg" alt="Logo: Karlsruher Institut für Technologie">';
|
||||||
|
echo '<img class="header-logo-mobile" src="' . get_bloginfo('stylesheet_directory') .'/img/kit-logo-without-text.svg" alt="Logo: Karlsruher Institut für Technologie">';
|
||||||
|
}?>
|
||||||
</a>
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue