[ad_1]
[ad_2]
I am trying to create different icons/favicons for different WordPress pages. I want each page to have a different icon so when someone adds it to their home screen from Safari on mobile or Android on Google, that the favicon that gets placed on the phone home screen is specific to the content on the page. Currently, it appears that I can only change the favicon of the whole site, not the specific pages. Does anyone have an easy workaround on this or a plugin that works? i have tried multicon and favicon plugins.. but they don't work.

Customizing favicons for different pages on a WordPress site can be a bit tricky, especially since most solutions typically handle site-wide favicons rather than individual page-specific ones. However, you can achieve your goal using a bit of custom coding. Here’s a step-by-step guide to set up different favicons for different pages:
### Method: Custom Code
1. **Create Favicon Images:**
Prepare your favicons for each page. Ensure they are in the `.ico` format or `.png` with appropriate sizes.
2. **Upload Favicon Images:**
Upload these favicon images to your WordPress media library or directly to your theme’s directory.
3. **Add Custom Code to Your Theme:**
– **Access Your Theme’s `functions.php`:** Navigate to Appearance > Theme Editor in the WordPress admin dashboard and select `functions.php`. Alternatively, you can use FTP or a file manager plugin to access this file.
– **Add Conditional Code to Change Favicons:**
Add the following code snippet to your `functions.php` file. This code checks the page ID or slug and then outputs a specific favicon for that page.
“`php
function custom_favicon_for_pages() {
if (is_page(‘page-slug’)) {
echo ‘<link rel=”icon” type=”image/png” href=”URL-to-your-favicon-for-this-page.png”>’;
} elseif (is_page(‘another-page-slug’)) {
echo ‘<link rel=”icon” type=”image/png” href=”URL-to-another-favicon.png”>’;
}
// Add more conditions as needed
}
add_action(‘wp_head’, ‘custom_favicon_for_pages’);
“`
– Replace `’page-slug’` with the actual slug of your page.
– Replace `’URL-to-your-favicon-for-this-page.png’` with the URL of your favicon image.
4. **Test Your Favicons:**
After saving the changes, visit the specific pages and add them to your home screen using a mobile browser. Verify if the favicons appear as expected.
Generated by chatgpt. You might want to try this out.
It’s doable (https://www.w3schools.com/html/html_favicon.asp) but somehow, IMHO, is against common use of favicon.
If one favicon is good for Apple, Microsoft, Google…
I have some doubts about the possibility. Normally favicons are heavily cached. If I changed favicons, it will take little time to reflect the changes.
If visitor only visit to a single page & then exit, it may be possible.