新增网站favicon

This commit is contained in:
2026-09-27 11:25:48 +08:00
parent d9946a3da4
commit 981ea44d5e
7 changed files with 18 additions and 1 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

+6 -1
View File
@@ -91,7 +91,12 @@ add_action( 'wp_enqueue_scripts', 'ming_assets' );
* Theme favicon.
*/
function ming_favicon() {
echo '<link rel="icon" type="image/png" href="' . esc_url( get_template_directory_uri() . '/assets/img/logo-mark.png' ) . '">' . "\n";
$asset_uri = get_template_directory_uri() . '/assets/img/';
echo '<link rel="icon" href="' . esc_url( $asset_uri . 'favicon.ico' ) . '" sizes="any">' . "\n";
echo '<link rel="icon" type="image/svg+xml" href="' . esc_url( $asset_uri . 'favicon.svg' ) . '">' . "\n";
echo '<link rel="icon" type="image/png" sizes="32x32" href="' . esc_url( $asset_uri . 'favicon-32.png' ) . '">' . "\n";
echo '<link rel="apple-touch-icon" sizes="180x180" href="' . esc_url( $asset_uri . 'apple-touch-icon.png' ) . '">' . "\n";
}
add_action( 'wp_head', 'ming_favicon' );