Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Favicon using wordpress

I am trying to change favicon in wordpress. For which i have uploaded image in media and in theme customisation, under site identity i used that image as a favicon.

Which is displaying in my admin panel but not in website browser. I tried to inspect it, so it is showing me below line but not coming image name in href

<link rel="icon" href="" type="image/x-icon">

So for that i need to change my each php file's head with appropriate code that is

<link rel="icon" href="http://my_url/image" sizes="32x32" />

but my question is, is there anyway where i can directly change it without going to all the pages' header in wordpress.

I also tried clearing cache and all the other solution, but not working.

like image 804
Niki Avatar asked Oct 04 '17 10:10

Niki


People also ask

Where is the favicon in WordPress?

Just go to Appearance > Customize in your site's dashboard, and then go to Site Identity > Site Icon. Upload a favicon via your Theme Options Page.

How do I add a favicon to my website?

To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico".


1 Answers

If your wordpress version is 4.2+, just add wp_head() in your header.php between <head> tags:

<?php wp_head(); ?>

You should be able to change the favicon from Administration Screen > Appearance > Customize now.

Function reference: wp_head()

like image 150
Hasan Shahriar Avatar answered Oct 03 '22 20:10

Hasan Shahriar