How to add favicon by Function

If you want to create a clear WordPress theme/template then it’s very import to optimize code and function. so if you use favicon for your site by function.php it’s will optimize your site greatly. To do so, Simply copy and paste the following code to your theme’s functions.php:

function my_theme_add_favicon(){ ?>
 
 <link rel="shortcut icon" href="/img/favicon.ico"/>
 <?php }
 add_action('wp_head','my_theme_add_favicon');

** Make sure to replace href attribute to point to your favicon file properly.

if you face any problem please let me know by comment

Testing My website How it looks on mobile devices when I don’t have any mobile device…

Today for any web developer it is very much important to test his site from a mobile device like iPhone, iPad or any other. And if he is developing a responsive website or Mobile website then it’s necessary to test the site from mobile device. But in some cases if you don’t have any Mobile device, How will you check the site ???

Don’t worry !!! This post will show you some solution for this & I hope it will help.

Okay, So if you are making a responsive website, you may use some online materials to test the site. Here are some url’s where you can test your site :
http://mattkersley.com/responsive
http://responsivepx.com

Go to any of these website & test your site. These sites will show preview of your site in different screen sizes.

However, If you’re making mobile version of your site where the site will detect device automatically, In that case you can change your user agent & test the site. Here I am going to Show you how to change user agent :

If you’re using Safari Browser ::

Launch Safari. From the Safari menu bar top of your screen click Safari. From the drop down menu click Preferences then select the Advanced tab.

Select: Show Develop menu in menu bar

Now from the Safari menu bar again, click Develop > User Agent
Change User Agent in Safari Browser

If You’re Using Chrome Browser ::

You have to use an extension to change user agent in chrome. I use this & it works nicely :

https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg?utm_source=chrome-ntp-icon

 

If You’re using Firefox :

For Firefox you may use this one or any other that you prefer to change user agent :

https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/

 

 

Thanks everyone for reading this article…