wordpress favicon not working properly on all browsers

Curious fact: the favicon works only on admin dashboard on chrome/opera. I've tried to clean the cache, but still not work. The line of code to the favicon its being included, buts it just doesnt work. I'm including the favicon through admin panel, to be dynamic. I just dont want to include it direct on the code. Firefox (Works) Edge (Works) Tor (Works) Chrome (Works only on admin dashboard) Opera (Works only on admin dashboard)
Category: Web

How to disable cropping of the site icon?

Is it possible to disable the cropping step when adding a site icon via the Theme Customizer in WordPress 5+ (occurred to me in 5.5)? For me cropping is unnecessary because I always upload a square image in the directions of the recommendations. That's why this step is not helping me at all, instead is actually causing the following problems: It creates an unnecessary copy of the image with a cropped prefix. For the cropped image it creates a NEW …
Category: Web

Favicon not loading until cookies are accepted?

I'm seeing a weird issue where my site's favicon is not loaded until I accept cookies on a cookie plugin. I wrote the plugin and as far as I know there is no tie of a favicon to cookies and the plugin doesn't explicitly block anything by default. I don't think the favicons are tied to a cookie anyways. Anyone seen this type of behavior before and know how to allow the favicon to load. Plugin Github
Category: Web

Trying to create a plugin to change wordpress site icons per page

I am trying to create a plugin to alter a WordPress websites default site icon set under appearance>customize. I am unable to find and good resources/examples on how to modify the existing site icon urls for the 4 different sizes created by default. I've read a lot on the different built in functions but can't put it together to get anything working. I currently have a case statement to check page id and then change the url ($favicon_link variable) to …
Category: Web

Getting an error. Need to add favicon in my child theme functions.php. What's wrong?

When I put this code in my functions.php add_action('wp_head', 'my_favicon'); function my_favicon() { echo "<link rel='shortcut icon' href=' " . get_stylesheet_directory_uri() . '/images/favicon.ico'"'>"; } I get [Message from webpage]: There has been a critical error on this website. Learn more about debugging in WordPress. What's wrong with my code?
Category: Web

Why does WordPress want a 512×512 pixel site icon

I get that a site icon needs to be square, but I don't know why it needs to be as large as 512×512 or larger. Can anyone advise why is this, and/or where that image would be used at a resolution higher than that of a favicon (which I understand to be 48×48px or smaller) and what would be the consequences of using a lower resolution image there?
Category: Web

Problem with favicon in the latest wp

Im having a problem with the favicon icon in WordPress 5.4.2. Im including my own favicon in the sites header.php, that is used for wp and wp non related static pages. The problem is that when I open a pdf file inside this site, the wp logo automatically appears as a favicon, instead of my site's icon. This would not happen in previous wp versions. Is there a way to change the wp icon to my sites icon, or just …
Category: Web

Not able to show the favicon to the uploads URL in WordPress

I am working on my client WordPress project and I have uploaded the PDF in the media. When I open the PDF URL, it is not showing the favicon. My client wants to show the favicon in the PDF url. I have added the favicon.ico in the directory where the wp-config is there but after that it is not showing the favicon. Any help is much appreciated.
Category: Web

Changable favicon

I am looking for help to put single page favicon that would overwrite global one. Say for example I have wordpress website that is example.com and it has favicon set for every page. What I want is for example.com/page3 to have diffrent favicon. I have seen quite a few options around but I cannot figure out how to make it work (my coding skills are limited). This solution: <?php echo '<link rel="shortcut icon" href="http://www.yoursite.com/favicon.ico?t=' . time() . '" />'; ?> …
Category: Web

Remove apple-touch-icon link generated by WordPress

I am adding Favicons and Icons to my site manually in a more proper way than what WordPress adds by default. My WordPress is generating the below 4 lines of code automatically. <link rel="icon" href="http://example.com/wp-content/uploads/sites/3/2015/09/cropped-group_logo-32x32.png" sizes="32x32"> <link rel="icon" href="http://example.com/wp-content/uploads/sites/3/2015/09/cropped-group_logo-192x192.png" sizes="192x192"> <link rel="apple-touch-icon-precomposed" href="http://example.com/wp-content/uploads/sites/3/2015/09/cropped-group_logo-180x180.png"> <meta name="msapplication-TileImage" content="http://example.com/wp-content/uploads/sites/3/2015/09/cropped-group_logo-270x270.png"> I tried a lot but could not figure out how to stop WordPress from generating this. Kindly help Update: After using the function provided by @Gareth, I am getting the following error: Warning: array_filter() …
Category: Web

How to display .ico files in the media library

I have added a .ico mime type into my WordPress site and I'm able to upload favicon files. But the media library only displays the default.png image for these images and also in the Customizer. How can I get WordPress to display these favicon images, in the media library and the customizer?
Category: Web

Conditional Logic to Check for Site Icon

From what I've read (Check if Favicon is set in Customizer and others), it appears checking to see if a site icon is set in a theme should be easy. It doesn't seem to be working for me. I'd like to have a set of default site icons set in my theme that can be overwritten if a user uploads a site icon. The code I have now is: <?php if( false === get_option( 'site_icon', false ) ) { ?> …
Category: Web

Posting with slug "favicon" gets redirected

I've created a WordPress posting with an URL slug "favicon": https://blog.zeta-producer.com/favicon/ Unfortunately this seems to somehow interfere with the favicon, because instead of showing the posting, I see an error message: Not Found The requested URL /favicon.ico/ was not found on this server. Probably some URL rewriting gets in the way. My question: Are there any workarounds (beside renaming the slug) to show my posting under the "favicon" slug? More information: I do have a /favicon.ico file in-place. (no trailing …
Category: Web

How to change in customizer the "site identity" tab required capabilities

I'm building a multisite in which site admins have no "manage options" capability. The problem is that withut this cap they cannot see the "site identity" tab in the customizer, where they can change the site icon (favicon) as well as the site's name. Is there a way to change the required capability to show this tab and save its contents? If not, is there a way to display the same fields as in this tab but in a custom …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.