Do not show WordPress 5.4 default WP blue favicon
<?php | |
//Inspiration: https://gist.github.com/florianbrinkmann/a879099f3d28c5e1d64f2aeea042becf | |
add_action( 'do_faviconico', function() { | |
//Check for icon with no default value | |
if ( $icon = get_site_icon_url( 32 ) ) { | |
//Show the icon | |
wp_redirect( $icon ); | |
} else { | |
//Show nothing | |
header( 'Content-Type: image/vnd.microsoft.icon' ); | |
} | |
exit; | |
} ); |
This comment has been minimized.
This comment has been minimized.
This is not intended to be inserted on the header tags. This is a PHP code snippet to be inserted on your child theme functions.php file or in a PHP code snippets plugin. |
This comment has been minimized.
This comment has been minimized.
Thank you!
…On Wed, May 13, 2020 at 12:10 AM Marco Almeida ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
This is not intended to be inserted on the header tags. This is a PHP code
snippet to be inserted on your child theme functions.php file or in a PHP
code snippets plugin.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/a7702e588070f9a1cfa12dff89b3573c#gistcomment-3302109>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKIDWEXLHEWGGGTEUX74SNTRRIMUTANCNFSM4M7LSYWA>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Hi! Thanks for making this, it fixed the favicon. However the script itself is showing at the top of the page (in inserted it in the head tags), do you know how to fix that?