Closed chrisblakley closed 7 years ago
I'm thinking we need an image upload for a "One-Color Logo" (and use "typically white") in the description under Site Identity
, and then a checkbox on both the Home > Hero and Posts > Header for "Use one-color logo".
Here's what I did:
<?php
$logo = get_theme_file_uri('/assets/img/logo.svg');
if ( get_theme_mod('custom_logo') ){ //If the Customizer logo exists
$logo = nebula()->get_thumbnail_src(get_theme_mod('custom_logo'));
if ( get_theme_mod('one_color_logo') ){ //If the one-color logo exists
if ( (is_front_page() && get_theme_mod('nebula_hero_single_color_logo')) || (!is_front_page() && get_theme_mod('nebula_header_single_color_logo')) ){ //If it is the frontpage and the home one-color logo is requested -OR- if it is a subpage and the header one-color logo is requested
$logo = get_theme_mod('one_color_logo');
}
}
}
?>
<img class="svg" src="<?php echo $logo; ?>" alt="<?php bloginfo('name'); ?>"/>
How will we detect when we need a white version of the logo vs. when to use the full color version? How will we get the white version? Expect an SVG or have a 2nd logo upload? Ideally we'd avoid bloat here.
How to other themes do this?