WordPress Favicon not Working For Images/Videos/PDFs

I am using WordPress with Neve theme, for my site, Favicon is working on posts/pages, but Favicons aren't visible for JPG/PNG/Videos.

If I use the Theme Customizer and select the Favicon PNG image, it shows on all posts and images etc.

But I want to have different Favicon Images on different URLs.

I saw that Theme was adding the below code on my site in Head.

link rel=apple-touch-icon sizes=72x72 href=https://milyin.com/wp-content/uploads/Icons/Icon72x72.png
link rel=icon type=image/png sizes=32x32 href=https://milyin.com/wp-content/uploads/Icons/Icon32x32.png
link rel=icon type=image/png sizes=16x16 href=https://milyin.com/wp-content/uploads/Icons/Icon16x16.png

this code was inserted wp_head to make it work.

It works perfectly on my posts and pages. For example the post How Does Elon Musk Manage all his Companies Effectively? the favicon is visible perfectly.

But if I Image from the save post The Image shows favicon as WordPress logo instead of my site logo.

How to make it WordPress logo programatically.

Topic icon headers images plugin-development theme-development Wordpress

Category Web


When opening media files only the file is loaded and not the html head of your file.

You can add a 'favicon.ico' file ('.png' may also work – not sure) to your root directory ('public_html/', 'www/' 'domain.com/' depending on server setup) and it should load even for media files as browsers are automaticly looking for an icon there.

About

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