Skip to content

Commit

Permalink
Use custom logo in sticky menu (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
albig committed May 29, 2024
1 parent 8bb95af commit b600ede
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
21 changes: 21 additions & 0 deletions sass/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,27 @@ body.admin-bar {
}
}

.wp-custom-logo {

.navbar {

&-main.stuck {

.navbar-brand {

height: unset;
width: unset;

background-color: transparent;

img {
height: 76px;
}
}
}
}
}

body {

&.search,
Expand Down
7 changes: 6 additions & 1 deletion template-parts/header-standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@
<div class="container">
<?php
$sunflower_options = get_option( 'sunflower_first_steps_options' );
if ( ( $sunflower_options['sunflower_terms_of_use'] ?? false ) === 'checked' ) {
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
$sunflower_custom_logo_id = get_theme_mod( 'custom_logo' );
$sunflower_custom_logo = wp_get_attachment_image_src( $sunflower_custom_logo_id, 'thumbnail' );
printf( '<a class="navbar-brand" href="%s">', esc_url( $sunflower_custom_logo[0] ) );
printf( '<img src="%s" class="custom-logo" alt="Logo" title="%s"></a>', esc_url( $sunflower_custom_logo[0] ), esc_attr( get_bloginfo( 'name' ) ) );
} elseif ( ( $sunflower_options['sunflower_terms_of_use'] ?? false ) === 'checked' ) {
printf( '<a class="navbar-brand" href="%s">', esc_url( get_home_url() ) );
printf( '<img src="%s" class="sunflower-logo" alt="Sonnenblume - Logo" title="%s"></a>', esc_attr( sunflower_parent_or_child( 'assets/img/sunflower.svg' ) ), esc_attr( get_bloginfo( 'name' ) ) );
}
Expand Down

0 comments on commit b600ede

Please sign in to comment.