Use sites Favicon also in cornerstone

Hi there,
since one of the last updates, the favicon in chrome’s browser tab changes to a white cornerstone-icon as soon as I use the cornerstone editor. Going back to the WP dashboard, the facicon of the website is shown again.
Can this be changed (either by me or by a future update)? I often work on several projects at the same time, i.e. to copy content or settings from one project to another. If all projects have the same favicon, I often open the wrong tab and I have to be very careful not to copy-paste in the wrong direction :wink:
Hope there is a way to change this behaviour!
Best regards
Uli

Hello @ULinn,

Thanks for writing to us.

Regretfully there is no option for that at the moment on the theme and Cornerstone page builder to set a custom favicon for the backend.

Thanks for understanding

Hey @ULinn,

There actually is a filter available for this since recently.

You could add this to your functions.php file:

// Change the Cornerstone favicon
function change_cs_favicon( $icon ) {
    $icon = get_stylesheet_directory_uri() . 'path-to-your-favicon-goes-here';
          return $icon;
    }
    add_filter(  'cs_app_favicon', 'change_cs_favicon'  );

Hey @JvP,
thank you for this code. The cornerstone favicon dissapears now, but my icon is not shown. Here’s the code I used:

$icon = get_stylesheet_directory_uri() . '/wp-content/uploads/2022/08/my_favicon.png';

I also tried

$icon = get_stylesheet_directory_uri() . 'https://www.mydomain.com/wp-content/uploads/2022/08/my_favicon.png';

  • also nothing. Any idea what’s wrong?

Best regards

Uli

Hi @prakash_s,
thank you for your reply.

Well, to be honest, I do not understand why there has to be a cornerstone icon instead of the sites icon. I don’t see any advantage in this, so it would be great to add changing this behaviour to the feature request list.

The code @JvP provided my be a workaround just for nwo, but I don’t want to manually add code to all of my pages and change it every time a favicon is changed.

Thanks for understanding :wink:

Uli

Hey Uli.

Change the line to the following, you were looking in the child theme directory. This sounds like a great item for a poll we’ve been wanting to do. It was a request for the favicon, but understand if it’s not everyone’s ideal. Have a great day.

 $icon = get_site_url() . '/wp-content/uploads/2022/08/my_favicon.png';
1 Like

Hi @charlie,
thank you, now it works as expected, great!
I’m looking forward to the poll, and am exited about what other themes can be voted on there .
Have a nice weekend!
Uli

1 Like

Hi Uli,

You are most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.