#51015 closed defect (bug) (duplicate)
has_custom_logo isn't working with Customizer
Reported by: | athemeart | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | |
Focuses: | Cc: |
Description
Hi
the has_custom_logo function isn't working perfectly with Customizer edit mod .
i am trying below code, it fine for without Customizer
if ( has_custom_logo() ) { echo the_custom_logo(); }else{ bloginfo( 'name' ); }
Change History (10)
#1
@
4 years ago
- Component changed from General to Customize
- Focuses javascript administration template performance coding-standards removed
#3
@
4 years ago
HI @SergeyBiryukov
it's my pleasure ,
has_custom_logo can't check empty / switch the if condition to else when activated Customizer. For more clarification, you can check video ( https://streamable.com/73iyqu )
Thanks
#4
@
4 years ago
Hello,
We have checked with WordPress 5.5 latest version installation, If we can select custom logo from customizer the logo is appeared on the front side and it is working fine.
For your issue i have tried to check but we are getting this site can't be reached error on the provided for more info url.
Are you getting any type of error on console or else?
Also could you please try to check with switch another theme?
Thanks,
#5
follow-up:
↓ 6
@
4 years ago
Hello @laxman-prajapati
Would you use like as below ...
if ( has_custom_logo() ) { echo the_custom_logo(); }else{ echo "isn't appearing with customizer "; }
Thanks
#6
in reply to:
↑ 5
@
4 years ago
Replying to athemeart:
Hello @laxman-prajapati
Would you use like as below ...
if ( has_custom_logo() ) { // it's working fine echo the_custom_logo(); }else{ // here is the issue echo "isn't appearing with customizer "; }Thanks
#8
@
4 years ago
I was able to reproduce with these steps:
- Add the
has_custom_logo
conditional code to the theme template file (likely header.php). - Open Customizer.
- Set an image as the logo.
- Click Publish and refresh the page.
- Then remove the logo image.
- Before publishing and refreshing the page, check results.
The blog name should show after removing the logo. However, the_custom_logo
still runs and gives the hidden linked image placeholder, even though has_custom_logo
should return false. It does seem to work correctly after publishing and refreshing the page.
Note also: the function the_custom_logo
does not need echo
(echo
is already part of it).
Hi there, welcome to WordPress Trac! Thanks for the report.
Could you clarify what exactly is not working, and what the expected result would be?
The steps to reproduce the issue on a clean install or some screenshots would be helpful too.