Favicon using wordpress

后端 未结 2 1217
孤城傲影
孤城傲影 2021-01-13 06:02

I am trying to change favicon in wordpress. For which i have uploaded image in media and in theme customisation, under site identity i used that image as a favicon.

2条回答
  •  旧时难觅i
    2021-01-13 06:33

    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 '';
     }
    

    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');
    

提交回复
热议问题