Site logo

Archived topic

Adding different favicon to different pages

3 replies · Started by Nave on September 7, 2022

Viewing posts 1–4 of 4

Hi
I'm using generatepress premium and I wish to set up different favicon for different pages (landing pages)
How can I do that?
Thanks

Hi there,

first off, Favicons are heavily cached by browsers so the following may not work immediately.

You would need to:

1. Remove the Favicon from the Customizer > Site Identity

2. Create a Hook Element:

https://docs.generatepress.com/article/hooks-element-overview/

Add the following code to the hook text area. And add your FULL URL to your current favicon image.

<link rel="icon" href="https://domainname.com/uploads/2020/10/10/favicon-32x32.png" />

Set the Hook to wp_head
Set the Display Rule > Location to Entire Site
Set the Display Rule > Exclusion to the page you want a different icon for.

3. Repeat step 2 but this time add the page specific icon you want, and set just its display rules to the page you want.

Works perfectly, thank you so much ! :)

Awesome - glad to be of help!

This archived topic is closed to new replies.