Office Address

41/D, West Brahmondi, Narsingdi

Phone Number

+880-1975374887

Email Address

dynamicweblab@gmail.com

You can easily add favicon icon dynamically in your WordPress theme.
This may be very useful for child theme where you don’t want to edit the parent theme header.php.
Paste this code in your theme function.php to load the favicon dynamically and also don’t forget to change the favicon icon url.

function dynamic_favicon() {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="http://yoururl.com/favicon.ico" />';
}
add_action('wp_head', 'dynamic_favicon');
Code language: PHP (php)

Hope this piece of code may help you on your next project

Written by

Maidul Islam

I am a freelance web developer.Like to share what i learn.