Last active
September 16, 2015 08:13
-
-
Save jimmy89Li/661e53eafc81cad83c5f to your computer and use it in GitHub Desktop.
PHP code inside functions.php to load facivon.ico file as your website favicon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add a favicon for your WordPress website | |
function blog_favicon() { | |
//this will load the favicon from the root directory of your blog | |
// echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('wpurl').'/favicon.ico" />'; | |
//this will load the favicon from the root directory of your theme | |
echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('stylesheet_directory').'/favicon.ico" />' . "\n"; | |
} | |
add_action('wp_head', 'blog_favicon'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment