/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//get domain from url function get_domain($url) { /* Author : Ayush URL : http://Webgarb.com */ return $url[0]; } //get favicon from google and cache it function getFavicon($var){ $cache_days = 30; $linkdomain = get_domain($var); $favicon_cache_dir = ABSPATH.'wp-content'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'favicon_cache'; $favicon_url = 'http://www.quakemachinex.com/blog/wp-content/plugins/favicon_cache/'.$linkdomain.'.png'; if ($fp && $favicon_stay_days < $cache_days) { return $favicon_url; } else { $local_favicon = $favicon_cache_dir.'/'.$linkdomain.'.png'; return $favicon_url; } }
URL: http://www.quakemachinex.com/blog/