Favicon using wordpress

有些话、适合烂在心里 提交于 2019-12-01 05:59:05

If your wordpress version is 4.2+, just add wp_head() in your header.php between <head> tags:

<?php wp_head(); ?>

You should be able to change the favicon from Administration Screen > Appearance > Customize now.

Function reference: wp_head()

Andrii Sukhoi

You can make it programatically through functions.php

First, create a function that includes the path to your favicon

 function add_favicon() {
      $favicon_url = get_stylesheet_directory_uri() . 'your_path';
      echo '<link rel="shortcut icon" href="' . $favicon_url . '" />';
 }

Now, just make sure that function runs when you're on the login page and admin pages:

add_action('login_head', 'add_favicon');
add_action('admin_head', 'add_favicon');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!