• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to add favicon in WordPress theme and child theme

January 25, 2014 by Sharad Chhetri 3 Comments

In this tutorial we will learn about,how to add favicon in WordPress theme and child theme.Favicon is important for branding of the site.Many website and blog are running on WordPress.If you are using a wordpress theme which do not have favicon option,you can add by this method.I used this code in theme which I have created from scratch,in thematic framework and other themes also.

Follow the given below steps to add favicon in wordpress theme

Step 1 : Open WordPress Editor

In Admin panel click on Appearance >> Editor

Step 2: Edit functions.php file

Edit the functions.php file of theme/child theme in wordpress. Paste the given below code in functions.php file

// Custom favicon Function to Include
function customfavicon_link() {
    echo '' . "n";
}
add_action( 'wp_head', 'customfavicon_link' );

Step 3: Upload favicon image

Now upload favicon image in Server at directory/folder where you have installed WordPress.

Step 4:Check favicon in the browser

Now open the web browser and type your wordpress site link. You can see the favicon on top of web browser(tab)

Possible troubleshooting,in case favicon is not visible

The below given are some possibilities because of which you are not able to see favicon on website.All troubleshooting are related to Cache.Hence if you have cache service apart from this, just clear the cache.

(1) Clear the cache of your web browser(user end troubleshooting)
(2) Clear the cache in server if you are using any cacheing server like varnish,nginx etc.
(3) Clear the cache if you are using CDN like cloudflare etc.
(4) If you are using WordPress cache plugin like WP super cache etc. ,clear the cache from it also.
(5) Check the favicon image by typing in browser http://example.com/favicon.ico . Replace example.com with your website url and name of favicon file which you have uploaded.If it is not showing favicon or showing error, it means either there is mistake in functions.php or favicon.ico file is not there/corrupted

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. How to add before entry widget in Genesis Child Theme
  2. How to add excerpt on wordpress thematic child theme
  3. How to customize footer credit links in Genesis Child Theme
  4. Create fixed top navigation menu bar on wordpress theme
  5. How To Add duckduckgo Search engine in WordPress Blog or website
  6. Add swap file in linux without reboot after OS installation
  7. How to add/install Ubuntu fonts in CentOS/Red Hat Linux
  8. How to install wordpress on LAMP stack ( Ubuntu 14.04 LTS Server )
  9. SimpleCodeSyntax : My Another WordPress Plugin
  10. Install latest wordpress in CentOS 6

Filed Under: Linux, Wordpress Tagged With: wordpress

Reader Interactions

Comments

  1. Jyoti says

    February 26, 2017 at 8:57 am

    This tutorial is very helpful. I had less experience with Favicon. Now I added favicon on my site and working fine. Thank you very much.

    Reply
    • Jay says

      April 14, 2020 at 4:32 pm

      Hi, as far as I can see, there is no ‘example.com’ in the code you are providing.

      Reply
      • Sharad Chhetri says

        May 9, 2020 at 2:54 am

        Hi Jay,

        I got that typo. Updating the post now.
        Thanks!

        Regards
        Sharad

        Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

How to convert rpm file into deb file

Keep logs of user after sudo su – : Secondary Logging

Password prompt in single user mode is not secure : CentOS/Red Hat

error could not configure a c compiler Linux

How to find when Operating system was installed in linux CentOS and Red Hat

Set GRUB password after installation of CentOS/Red Hat

send email after mysql backup through bash script in simple way

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy