Created
December 27, 2018 19:03
-
-
Save brianpurkiss/941a85738a59937a879aafc693319ed8 to your computer and use it in GitHub Desktop.
Adding a favicon to WordPress through functions
This file contains 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
<?php | |
// Setup favicon call | |
function add_favicon() { | |
$favicon_url = get_stylesheet_directory_uri() . '/library/images/favicon.png'; | |
echo '<link rel="shortcut icon" href="' . $favicon_url . '" />'; | |
} | |
// Adds favicon to WP Frontend and WP Dashboard | |
add_action('wp_head', 'add_favicon'); | |
add_action('login_head', 'add_favicon'); | |
add_action('admin_head', 'add_favicon'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment