• I created two new WordPress websites: (1) a main site, and (2) a subsite (with its own WordPress installation) in a subfolder of the main site. The subsite has its own favicon set through its WordPress site customizer. All the webpages on the subsite show the correct favicon that I uploaded. Unfortunately, though, when any media files (for example PDFs, images) on the subsite are opened in a browser window, they all show the favicon of the main site, even though they are in the subsite. How can I specify that media files in the subsite use the subsite’s favicon? I’m not sure if this is a bug in WordPress or just a limitation that requires customization.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • How can I specify that media files in the subsite use the subsite’s favicon? I’m not sure if this is a bug in WordPress or just a limitation that requires customization.

    This is not a bug in WordPress. In fact, this has nothing to do with WordPress.

    When you open a media file like example.com/some/path/here/some-file.pdf, the browser just sees everything preceding the file name some-file.pdf as directories… the browser has no knowledge of what is inside any of these directories, let alone there being a WordPress site.

    So most browsers simply display the favicon.ico file if one is located at the ROOT of the site. If there is none, no favicon is displayed at all. In the case of WordPress, a request for the non-existing favicon at example.com/favicon.ico gets redirected to the configured site icon for the site at example.com (If you were to place an actual favicon.ico file at the ROOT of https://www.ncjusd.org, it would be used instead as the favicon for media files viewed directly in the browser.)

    I hope that, at least, clarifies what’s going on.

    Thread Starter jkrakar

    (@jkrakar)

    Is there any way to get around this? Is there any code to specify multiple favicons so that the subsite media files would pull the subsite’s favicon? Or a way to just specify that no favicon should be displayed for the media library items?

    Or would I need to change the subsite into a subdomain to have a separate favicon for the media files?

    • This reply was modified 3 years, 5 months ago by jkrakar.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue with subsite media files showing wrong favicon when opened in browser’ is closed to new replies.