0

I place my favico favico.ico on the root directory of my site.

Add the following code to wp-content/themes/f2/header.php:

<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico" />

However, the favicon is ONLY appeared on the homepage? How can I make it effective on the whole site?


EDIT: I set the href as the abosolute path and it works, seeing below:

<link rel="shortcut icon" href="http://example.com/favicon.ico" />
1
  • 1
    Running the latest version of WordPress, you can upload a favicon using Appearance -> Customize -> Site Identity -> Site Icon which will take care of a lot of this stuff for you.
    – Howdy_McGee
    Sep 15 '15 at 14:03
1

I set the href as the abosolute path and it works, seeing below:

<link rel="shortcut icon" href="http://example.com/favicon.ico" />

Or as suggested by @Caspar and @Howdy_McGee, for wordpress 4.3+, use:

Dashboard -> Appearance -> Customize -> Site Identity -> Site Icon

1
  • 2
    Or, if you're using WP 4.3+ you can use the site icon setting in the customizer. (Appearance > Customize > Site Identity )
    – Caspar
    Sep 20 '15 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.