Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created August 13, 2018 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/c16576fec21351a1c139c6cc5bafb76a to your computer and use it in GitHub Desktop.
Save billerickson/c16576fec21351a1c139c6cc5bafb76a to your computer and use it in GitHub Desktop.
<?php
/**
* Large Favicon
*
* @author Bill Erickson
* @see https://www.billerickson.net/code/large-favicon/
*
* @param string $url, favicon image url
* @param int $size, size in pixels
* @return string $url
*
*/
function ea_large_favicon( $url, $size ) {
if( intval( $size ) >= 128 ) {
$favicon_id = 88; // uploaded to media library
$url = wp_get_attachment_image_url( $favicon_id, array( $size, $size ) );
}
return $url;
}
add_filter( 'get_site_icon_url', 'ea_large_favicon', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment