Wordpress: Insert a favicon.ico


/ Published in: PHP
Save to your folder(s)

Insert a favicon using functions.php


Copy this code and paste it in your HTML
  1. /**
  2. * Add a Favicon
  3. * This prevents you from having to worry about updating your theme and losing your favicon.
  4. *
  5. */
  6. function add_favicon(){
  7. echo "<link rel='shortcut icon' href='" . get_stylesheet_directory_uri() . "/favicon.ico' />" . "n";
  8. }
  9. add_action( 'wp_head', 'add_favicon');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.