Favicon not working for wordpress site - wordpress

I am trying to add favicon to mysite but it is not working. I have put my favicon to C:\xampp\htdocs\wordpress\wp-content\themes\expound folder
Then in header.php file, I put the code below:
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico" />

Have you tried selecting your site's "icon" in the admin panel? It's a little hard to find, but it's there.

Open your site then customize -> open Site Identity -> Set Site Icon after you can show favicon icon.

Related

Where is the favicon?

This might be a silly question... I usually add my Favicon's in the area of the my site, but a previous developer has set this website up.
I usually add code a bit like this:
<link rel="shortcut icon" href="<?php echo get_template_directory_uri(); ?>/assets/images/favicon/favicon.ico" type="image/x-icon">
The site has a favicon but I can't find where its being created, or even where its being held in the WordPress theme: https://www.sbccanford.co.uk/
Any ideas? I've popped the URL to the website above.
Thanks,
Meg
It seems that was added in the customizer. Go to Admin Dashboard -> Appearence -> Customize -> Site identity. and its there.

Wordpress favicon hack

A wordpress site of mine got hacked and there appears to be a favicon left by the hacker.
I cannot see it anywhere in the theme, there is no shortcut line in the header
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico" />
Any ideas where this file can be?
This is due to caching. You have to refresh it to remove the old icon.
Locate the favicon resource of your site by navigating to <YOUR SITE URL>/favicon.ico in your browser and do a hard refresh.
If the above doesn't work, try setting a new favicon by adding this to your current theme's header.php file.
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico?ver=new" /> and upload the new favicon to the appropriate location.

How to get magento header in wordpress

I am having word press installed in side a sub directory of magento like
---Magento
----wp
--Blog (This is word press directory)
In word press we have header.php in theme folder.There I am trying to access the magento header block.
I am able to get this following way(Below code is written in head section of header.php of wordpress)
Mage::getLayout()->createBlock('page/html_head')->toHtml();
When I echo this I am able to get the magento header.But the css and js of magento application are not rendered as well the word press application is halting after rendering the content of magento. i.e nothing comes after header.
Please suggest me idea how can I get the css and js of magento application and the wordpress content properly?
The dirty way is to link Magento JS and CSS in your header.php file. like
<script type="text/javascript" src="<?php getSkinUrl('jsfolder/js.js') ?>"></script>
<link rel="stylesheet" type="text/css" href="<?php getSkinUrl('cssfolder/style.css') ?>">
There's actually a tweak in page.xml file but I wonder how, or why not to play it yourself?

Favicon stopped working in Chrome all of the sudden

I have this code used in my WP theme:
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/images/fav.ico?<?php echo date('U'); ?>">
and not cache it, since <?php echo date('U'); ?>. My problem is, and my client reported it to me today, that the favicon stopped showing only in Chrome. I tried moving it to the root of the page, adding type, removing the "refresh" hack, changing name to favicon.ico and even adding additional link icon for PNG image. Nothing helps. Yes, I've been trying to
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/images/fav.ico?v=2">
Can someone help me with this one?
If you have messed up with the code then use plugins like http://wordpress.org/plugins/custom-favicon/
This plugin will override your theme favicon functionality and will help you with your desired result.
This should help.

how to attach company logo in Web Application URL in the address bar

Please tell me how to add company logo with web application url address bar
Add <link rel="shortcut icon" href="/favicon.ico"> to <head /> and put favicon.ico to your website.
It's called a favicon (StackOverFlow Thread)
Please create a small image and create a link and paste in to your head section to ........... when you open your site then this icon show you on top .........Thanks.

Resources