add favicon support
This commit is contained in:
@@ -164,9 +164,14 @@ function cors() {
|
|||||||
if(WP_ENV == 'development'):
|
if(WP_ENV == 'development'):
|
||||||
header( 'Access-Control-Allow-Origin: *' );
|
header( 'Access-Control-Allow-Origin: *' );
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_action('wp_head', function(){
|
||||||
|
if(file_exists(get_theme_file_path('resources/images/favicon/site.webmanifest'))) {
|
||||||
|
echo \Roots\view("partials.favicon")->render();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
add_action('after_setup_theme', function(){
|
add_action('after_setup_theme', function(){
|
||||||
$image_srcset = new Utilities\ImageSrcset;
|
$image_srcset = new Utilities\ImageSrcset;
|
||||||
$image_srcset->add(['name' => 'hero', 'width' => 1920, 'height' => 1080]);
|
$image_srcset->add(['name' => 'hero', 'width' => 1920, 'height' => 1080]);
|
||||||
|
|||||||
0
resources/images/favicon/.gitkeep
Normal file
0
resources/images/favicon/.gitkeep
Normal file
6
resources/views/partials/favicon.blade.php
Normal file
6
resources/views/partials/favicon.blade.php
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<link rel="icon" type="image/png" href="{{ Vite::asset('resources/images/favicon/favicon-96x96.png') }}" sizes="96x96" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="{{ Vite::asset('resources/images/favicon/favicon.svg') }}" />
|
||||||
|
<link rel="shortcut icon" href="{{ Vite::asset('resources/images/favicon/favicon.ico') }}" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="{{ Vite::asset('resources/images/favicon/apple-touch-icon.png') }}" />
|
||||||
|
<meta name="apple-mobile-web-app-title" content="{!! $title !!}" />
|
||||||
|
<link rel="manifest" href="{{ Vite::asset('resources/images/favicon/site.webmanifest') }}" />
|
||||||
Reference in New Issue
Block a user