[Resolved] Favicon not work correctly

Home Forums Support [Resolved] Favicon not work correctly

Home Forums Support Favicon not work correctly

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #635440
    Clevelus

    If set favicon brousers show it correctly … But Yandex Webmasters and other is show error for ico file.
    https://docs.generatepress.com/article/site-identity-overview/
    If checked this: https://realfavicongenerator.net/favicon_checker
    Errors:
    favicon.ico is missing some icons of recommended sizes (16×16, 32×32, 48×48)
    Image https://site.name/favicon.ico is ill-formed
    Image … may not be useful regarding its size

    For iOS Safari errors:
    Image … may not be useful regarding its size
    There is no Touch icon in the root directory

    And other errors.

    If install the plugin https://ru.wordpress.org/plugins/favicon-by-realfavicongenerator/ , is not fully work with GeneratePress theme (see topic link).

    #635594
    Tom
    Lead Developer
    Lead Developer

    Some tools check the root directory of your website for a favicon.ico file.

    WordPress has a “site icon” option in “Customize > Site Identity” which sets the favicon a different way.

    Those tools are likely looking in the root directory for the .ico file, so if you add that, you shouldn’t have any issues.

    The favicon is separate from any theme or plugin, as the .ico file in the root directory applies to any website (including non-WordPress sites), and the site icon option is a core WordPress option.

    #636440
    Clevelus

    If you put the favicon.ico by hand in the root of the site – this solves the problem.
    But it’s not right. ๐Ÿ™

    #636595
    Tom
    Lead Developer
    Lead Developer

    What about it isn’t right?

    #636960
    Clevelus

    I wrote that it was not so.
    Some sites and browsers require an ISO file. This is normal and it’s standard. If you put third-party plug-ins, then they form this file as well.
    But as a result in GeneratePress, the file https://your-site/favicon.ico is opens, but in png format (or other format). The extension does not match the file type. The file size is not according to the standard. And there are errors.

    #637078
    Tom
    Lead Developer
    Lead Developer

    I’m sorry, I don’t really understand what you mean?

    Themes themselves (whether it’s GP or another theme) shouldn’t have any effect on the favicon at all. Your browser either looks for a favicon.ico file in the root directory of the theme, or it looks for meta tags in the <head> of your site, which are added by WordPress if you set the Site Icon in the Customizer: https://www.wpbeginner.com/wp-tutorials/how-to-add-a-favicon-to-your-wordpress-blog/

    Are you saying when you open the favicon.ico file in your browser, the result is different than what you expect?

    #637082
    Clevelus

    I’m use plugin https://ru.wordpress.org/plugins/favicon-by-realfavicongenerator/
    This plugin generate ico files and favicon.ico, but WordPress with GeneratePress don’t show it.
    I’m copy favicon.ico from plugin directory to site root (other icon files work fine) and this is worked.

    #637133
    Tom
    Lead Developer
    Lead Developer

    That’s good! So it’s all fixed now? ๐Ÿ™‚

    #637146
    Clevelus

    I did not write the plugin author.
    The main error is favicon.ico

    Goto
    https://generatepress.com/favicon.ico — good
    (But if you remove the Favicon from the root of the site, there will be no 404 error, the picture will open but it will not display correctly.)
    and check
    https://realfavicongenerator.net/favicon_checker?protocol=https&site=generatepress.com
    See last section “Classic, desktop browsers”

    For Generatepress site:
    favicon.ico is present — good!
    But: favicon.ico is missing some icons of recommended sizes (48×48)
    Ok.
    But if you remove the Favicon from the root of the site?

    This manual https://www.wpbeginner.com/wp-tutorials/how-to-add-a-favicon-to-your-wordpress-blog/ is Error or not working in GeneratePress.
    PNG not equal ICO – this is error!
    And some services will give a error for favicon (as Yandex Webmaster and other)!

    I solved the problem by putting the correct file in the root of the site. And since it is present, it does not call the PHP (which returns the file if it is not physically present).
    But it’s not right.

    #637290
    Tom
    Lead Developer
    Lead Developer

    Thanks for that, just updated our favicon size.

    I did some looking around and found this: https://stackoverflow.com/questions/51398737/favicon-ico-missing-of-size-32×32-48×48-although-its-declared

    It seems his tool will output that warning if favicon.ico is missing from the root directory, even if you’ve declared the icons elsewhere.

    #637300
    Clevelus

    If I delete the Favicon at the root of the site, then still, when I request https://site-name/favicon.ico, WordPress displays something. It’s the wrong size and wrong format (png instead of iso)

    For different tasks there should be different icons. This is optional.

    But if something is returned to the query https://site-name/favicon.ico, it must be strictly formatted. As I understand it.

    Either an error (404) on requesting https://site-name/favicon.ico, it’s bad but not an error. Or return the correct favicon.ico (only such a name, the right format, one of the right sizes).

    #637327
    Tom
    Lead Developer
    Lead Developer

    Are you sure what you’re seeing isn’t just cached? WordPress itself shouldn’t serve a file at that URL if the file itself doesn’t exist. Of course, I’m not an expert when it comes to favicons, so perhaps there is something happening in the background within WP itself when favicon.ico isn’t reachable.

    #637331
    Clevelus

    No. Caching has nothing to do with it.
    I have repeatedly met on forums that the WordPress Themes can misbehave favicon. WordPress does not mean placing an icon in the root with your hands, this should be done by the topic.

    Try to delete (change the name) in the root of the Favicon. And then open it simply in the browser (or check the server’s response). The server response is 200 and the picture is returned (but in the case of the GeneratePress theme of the wrong format and size).

    #637358
    Tom
    Lead Developer
    Lead Developer

    That’s super strange – I’m not sure what could be causing that. The theme itself doesn’t have any favicon related code in it at all.

    Here’s a vanilla GP install: http://tomusborne.com/dev/

    And the calling favicon.ico gives us a 404 (as it should): http://tomusborne.com/dev/favicon.ico

    #637517
    Clevelus

    Favicon ONLY in root site.
    See: http://tomusborne.com/favicon.ico

    Google shows the globe if the icon is not set or has errors
    http://www.google.com/s2/favicons?domain=tomusborne.com

    But there is an icon! It’s the wrong format (even the browser can not display), possibly of the wrong size.
    favicon with errors

    Check: https://realfavicongenerator.net/favicon_checker?protocol=https&site=tomusborne.com
    And see: two gross errors (the last error is 48x, the standard (imho) is not an error, but a warning)
    favicons errors

    favicon.ico is present !!!

    http://site and https://site and https://site:8091 – these are different sites
    http://www.site and http://site – these are different sites
    http://site and http://site/dir – this is the same site

    Different sites can have different content.

    If the sites are mirrors, then a redirect with code 301 to the main mirror must be installed (not necessarily, there may be 200 code, but the content should coincide by more than 80%, but a highly recommended redirect with code 301). In this case, each site should give its own: favicon.iso (without redirection, otherwise it will be considered that there are no icons on this site), robots.txt (it is desirable, while the HOST directive should point to the main mirror), sitemap.xml (preferably on the main mirror and not necessarily on the referring sites).
    If the site does not return its icon, for example, a redirect to everything, then this site does not have an icon. Often this does not cause problems, but they can be. And the redirect does not apply to the topic itself. I make special exceptions in nginx (or .htaccess).

    location ~ /(robots\.txt|sitemap*\.xml|yandex_*\.html|wmail*\.html|google*\.html|favicon.ico)$ {
    	allow all;
    	log_not_found off;
    	access_log off;
    	try_files $uri $uri/ /index.php?$args;
    }
    location / {
    	return 301 https://$host:443$request_uri;
    }

    But this is no longer relevant to the theme established in WordPress (usually, sometimes it depends on the topic)

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.