Skip to content

Commit

Permalink
Add CSS class for sunflower-logo and custom-logo
Browse files Browse the repository at this point in the history
  • Loading branch information
albig committed Apr 18, 2024
1 parent 171ecd0 commit 6aa0cd7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 4 additions & 1 deletion sass/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,11 @@ body {
}

.img-container {

&.sunflower-logo {
background-color: $secondary;
}
margin-right: 0.25rem;
background-color: $secondary;
height: 95px;
width: 95px;
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions template-parts/header-personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<div class="container">
<div class="d-flex w-100">
<div class="container d-flex align-items-center bloginfo">
<div class="img-container">
<div class="img-container <?php if (has_custom_logo()) { echo 'custom-logo'; } else { echo 'sunflower-logo'; }?>">
<?php
if (function_exists('the_custom_logo') && has_custom_logo()) {
the_custom_logo();
} else {
echo '<a href="' . get_home_url() . '" rel="home" aria-current="page" title="' , get_bloginfo('name') . '">';
$options = get_option('sunflower_first_steps_options');
if (($options['sunflower_terms_of_use'] ?? false) == true) {
printf('<img src="%s" class="" alt="Logo">', sunflower_parent_or_child('assets/img/sunflower.svg'));
printf('<img src="%s" class="sunflower-logo" alt="Logo">', sunflower_parent_or_child('assets/img/sunflower.svg'));
}
echo '</a>';
}
Expand Down
16 changes: 8 additions & 8 deletions template-parts/header-standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<div class="container-fluid bloginfo bg-primary">
<div class="container d-flex align-items-center">
<div class="img-container">
<div class="img-container <?php if (has_custom_logo()) { echo 'custom-logo'; } else { echo 'sunflower-logo'; }?>">
<?php
if (function_exists('the_custom_logo') && has_custom_logo()) {
the_custom_logo();
Expand Down Expand Up @@ -74,13 +74,13 @@
<div id="navbar-sticky-detector"></div>
<nav class="navbar navbar-main navbar-expand-lg navbar-light bg-white">
<div class="container">
<a class="navbar-brand" href="<?php echo get_home_url(); ?>">
<?php
if (($options['sunflower_terms_of_use'] ?? false) == true) {
printf('<img src="%s" class="" alt="Sonnenblume - Logo" title="%s">', sunflower_parent_or_child('assets/img/sunflower.svg'), get_bloginfo('name'));
}
?>
</a>
<?php
$options = get_option('sunflower_first_steps_options');
if (($options['sunflower_terms_of_use'] ?? false) == true) {
printf('<a class="navbar-brand" href="%s">', get_home_url());
printf('<img src="%s" class="sunflower-logo" alt="Sonnenblume - Logo" title="%s"></a>', sunflower_parent_or_child('assets/img/sunflower.svg'), get_bloginfo('name'));
}
?>
<button class="navbar-toggler collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#mainmenu-container" aria-controls="mainmenu" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-times close"></i>
<i class="fas fa-bars open"></i>
Expand Down

0 comments on commit 6aa0cd7

Please sign in to comment.