This package for WordPress (Sage & Acorn) automatically generates a manifest.webmanifest JSON file. It also creates maskable versions of the favicon that will be used as the icons.
To install this package using Composer, follow these steps:
-
Install this package with Composer:
composer require yard/webmanifest
-
Run the Acorn WP-CLI command to discover this package:
wp acorn package:discover
You can publish the config file with:
wp acorn vendor:publish --provider="Yard\Webmanifest\WebmanifestServiceProvider"In theory you don't have to do anything, the Webmanifest works out of the box. This packages uses the favicon set in the theme to generate icons.
But you can alter behavior via the configuration.
You can do this by adding them to the icons array in the config
'icons' => [
[
'src' => 'path/to/icon.png',
'sizes' => '192x192',
'type' => 'image/png',
],
],You can set the background and theme color by changing the config values below.
'background_color' => '#add8eb',
'theme_color' => '#ffffff','iconSizes' => [192, 384, 512, 1024],'url' => '/manifest.webmanifest','iconUrl' => '/webmanifest/icon',