#43081 closed defect (bug) (invalid)
Custom logo issue in Customizer
Reported by: | Guido07111975 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | |
Focuses: | Cc: |
Description
Hi,
Almost 2 years ago I've started a thread about an issue with the custom logo in customizer. Link: https://wordpress.org/support/topic/custom-logo-issue-in-customizer/
Until now it's not fixed.
In short, this doesn't behave as expected:
<?php if ( has_custom_logo() ) : ?> <?php the_custom_logo(); ?> <?php else : ?> <h1>Site Title</h1> <h2>Tagline</h2> <?php endif; ?>
Once a custom logo is set, and removed again in the same session, Site Title and Tagline aren't displayed. You need to close and re-visit the customizer, to make Site Title and Tagline visible again.
It seems the custom logo stays active, after removing the logo (image) in the same session.
Guido
Change History (4)
#2
@
7 years ago
Hi @lrdn
Your fix works fine, so thank you for that.
I don't have enough knowledge to determine whether this should be fixed in core or not.. so let's wait what others say.
Thanks again :-)
Guido
#3
@
5 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
- Version 4.9.1 deleted
I agree with comment:1 that the current behavior is expected given the use of the postMessage
transport. Changing the setting to refresh
is one way to work around the behavior if the theme isn't set up for postMessage
. The default themes also showcase how the custom logo can be integrated with the Customizer's selective refresh framework.
The custom logo setting uses the
postMessage
transport by default which requires changes to be handled manually using JavaScript. You can however simply override the transport setting withrefresh
to automatically reload the preview. In my opinion that's not a bug and won't require any changes to the WordPress core.