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
    Commented Sep 15, 2015 at 14:03

1 Answer 1

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
    Commented Sep 20, 2015 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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