Home / functions.php / Insert favicon with function
  • How to Insert favicon with function

    no thumbnail sorry: Insert favicon with function

    Adding this PHP code to your functions.php of your wordpress theme will insert the HTML for your favicon.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    function myfavicon() {
    	echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('wpurl').'/favicon.ico" />';
    }
    add_action('wp_head', 'myfavicon');
    

    ( WordPress codex functions, hooks, in this snippet. )

    bloginfo, wp_head, add_action, get_bloginfo, wp,