Favicon - Wordpress

Stagger Lee
1796 Posts
Stagger Lee posted this 22 October 2016

There is no need to vote for it, simple task for your developer.
Add Favicon to backend browser tabs. Makes it easy to develop websites when working on several simultaneously. I know it can be done manually easy, but so many steps when developing. It would be nice if your developers can generate this code too.

function add_login_favicon() {
    $favicon_url = 'http://www.custom/wp-content/themes/custom/images/favicon.ico';
    echo '<link rel="shortcut icon" href="' . $favicon_url . '" />';
}
add_action('login_head', 'add_login_favicon');
add_action('admin_head', 'add_login_favicon');

There is no need to vote for it, simple task for your developer. Add Favicon to backend browser tabs. Makes it easy to develop websites when working on several simultaneously. I know it can be done manually easy, but so many steps when developing. It would be nice if your developers can generate this code too. function add_login_favicon() { $favicon_url = 'http://www.custom/wp-content/themes/custom/images/favicon.ico'; echo '<link rel="shortcut icon" href="' . $favicon_url . '" />'; } add_action('login_head', 'add_login_favicon'); add_action('admin_head', 'add_login_favicon');
Vote to pay developers attention to this features or issue.
14 Comments
Order By: Standard | Newest
Stagger Lee
1796 Posts
Stagger Lee posted this 22 October 2016

And second request, a bit different.

Please, please convert all images uploaded for Favicons to "favicon.ico" filename, and 16x16 px. As it is now we can use 2 MB image and massiv in resolution for Favicon. Many people wont even notice this huge problem. Favicon is pulled on each page reload/click/refresh.

At least it was last time I checked it.


If all images uploaded are mandatory renamed in background to "favicon.ico" we can use this snippet and dont bother what image is named. (favicon.ico naming is standard somehow)

function pa_admin_area_favicon() {
$favicon_url = get_bloginfo('url') . '/images/favicon.ico';
echo '<link rel="shortcut icon" href="' . $favicon_url . '" />';
}


add_action('admin_head', 'pa_admin_area_favicon');

And second request, a bit different. Please, please convert all images uploaded for Favicons to "favicon.ico" filename, and 16x16 px. As it is now we can use 2 MB image and massiv in resolution for Favicon. Many people wont even notice this huge problem. Favicon is pulled on each page reload/click/refresh. At least it was last time I checked it. --------------------------- If all images uploaded are mandatory renamed in background to "favicon.ico" we can use this snippet and dont bother what image is named. (favicon.ico naming is standard somehow) function pa_admin_area_favicon() { $favicon_url = get_bloginfo('url') . '/images/favicon.ico'; echo '<link rel="shortcut icon" href="' . $favicon_url . '" />'; } add_action('admin_head', 'pa_admin_area_favicon');

Last edited 22 October 2016 by Stagger Lee

Support Team
Support Team posted this 25 October 2016

Hello Stagger Lee,
thank you for your proposals. I'm passing them both to developer team.

regards,
Aileen

Hello Stagger Lee, thank you for your proposals. I'm passing them both to developer team. regards, Aileen
shaulhadar
403 Posts
shaulhadar posted this 25 October 2016

Good find stagger!

Good find stagger!
Stagger Lee
1796 Posts
Stagger Lee posted this 25 October 2016

This problem with proper favicon.ico is in their interest from sales standpoint. No need that themes are slow just because someone uploaded huge favicon via Themler options.

It should not exist in Themler themes. Favicon.ico as image say 2MB and 1200x800 px. Just example, can be anything.

If they dont have time now for proper code for resizing and adapting images in background when someone use this option one simple check would be enough to start with. If is over say 32x32 px show error and refuse to use that image.

This problem with proper favicon.ico is in their interest from sales standpoint. No need that themes are slow just because someone uploaded huge favicon via Themler options. It should not exist in Themler themes. Favicon.ico as image say 2MB and 1200x800 px. Just example, can be anything. If they dont have time now for proper code for resizing and adapting images in background when someone use this option one simple check would be enough to start with. If is over say 32x32 px show error and refuse to use that image.
Krav
73 Posts
Krav posted this 29 October 2016

Hi Stagger Lee,

Thanks for the explanation re the ‘Flavicon’, it helped a lot.

Knowing that you are extremely proficient with CSS, I would be extremely grateful if you could point me in the right direction regarding a couple of lines of CSS please?

I have a one page website with 8 sections. When clicking the menu items, each section scrolls up to the fixed header, but unfortunately stop underneath the header and loose their title and some text. It would be great if the top of each section could snap to the ‘bottom' of the fixed header (on all devices)! Themler support have been very helpful (suggesting creating a margin the same depth as the header - it works well, but does not really look professional enough on all devices), but ultimately they suggested it may need a bit of CSS - fair enough. I’m learning CSS at the moment, but this would be a little beyond me.
Would you be able to advise?

The closest I’ve come to finding a solution is on: http://stackoverflow.com/questions/4086107/html-positionfixed-page-header-and-in-page-anchors/9618795#9618795 but I would not know what to change so that it relates to my header and how to implement it within Themler.

Thanks in advance for any help.

Cheers Krav

Hi Stagger Lee, Thanks for the explanation re the ‘Flavicon’, it helped a lot. Knowing that you are extremely proficient with CSS, I would be extremely grateful if you could point me in the right direction regarding a couple of lines of CSS please? I have a one page website with 8 sections. When clicking the menu items, each section scrolls up to the fixed header, but unfortunately stop underneath the header and loose their title and some text. It would be great if the top of each section could snap to the ‘bottom' of the fixed header (on all devices)! Themler support have been very helpful (suggesting creating a margin the same depth as the header - it works well, but does not really look professional enough on all devices), but ultimately they suggested it may need a bit of CSS - fair enough. I’m learning CSS at the moment, but this would be a little beyond me. Would you be able to advise? The closest I’ve come to finding a solution is on: http://stackoverflow.com/questions/4086107/html-positionfixed-page-header-and-in-page-anchors/9618795#9618795 but I would not know what to change so that it relates to my header and how to implement it within Themler. Thanks in advance for any help. Cheers Krav
Stagger Lee
1796 Posts
Stagger Lee posted this 29 October 2016

Then dont anchor to fixed header but insert one new (and empty) HTML control (under header). The you can anchor to this div class, found with code inspector. If I understood it well. Anchoring to some fixed header is very dependent od content inside this header. Here you have empty class, allways empty of content, allways same height (better said zero height). Easy for manipulation.

Then dont anchor to fixed header but insert one new (and empty) HTML control (under header). The you can anchor to this div class, found with code inspector. If I understood it well. Anchoring to some fixed header is very dependent od content inside this header. Here you have empty class, allways empty of content, allways same height (better said zero height). Easy for manipulation.

Last edited 29 October 2016 by Stagger Lee

Krav
73 Posts
Krav posted this 29 October 2016

Hi Stagger Lee,
Thanks for coming back to me so quickly, and at the weekend - wow!

Sounds like a sensible plan.

I've added an HTML control just underneath the header, is this what you meant - please see .zip file attached for reference? Is there any way to fix this, as per the header, so that it is always there regardless of the size or shape (responsiveness) of the header itself, and also, so the sections (pages) can anchor to it?

Each section (page) already contains an 'HTML control' with the section (page) ID within it (as per the Themler guidance info), for example: id ='design'. Do I need to add any alternative or extra code to these, so that they know where to anchor themselves?

Thanks for your patience and understanding.

Krav

Hi Stagger Lee, Thanks for coming back to me so quickly, and at the weekend - wow! Sounds like a sensible plan. I've added an HTML control just underneath the header, is this what you meant - *please see .zip file attached for reference*? Is there any way to fix this, as per the header, so that it is always there regardless of the size or shape (responsiveness) of the header itself, and also, so the sections (pages) can anchor to it? Each section (page) already contains an 'HTML control' with the section (page) ID within it (as per the Themler guidance info), for example: id ='design'. Do I need to add any alternative or extra code to these, so that they know where to anchor themselves? Thanks for your patience and understanding. Krav
Stagger Lee
1796 Posts
Stagger Lee posted this 29 October 2016

I dont get all. This example from your link is complicated. Can you give some demo example of that you want ?

There is 2 ways to do it very easy:

  • Anchor links in menu and custom ID (I was wrong class wont work)
  • Use whole header as Extension - Sticky.
    It was my mistake, this example. Was thinking on something different. All 8 sections need 8 unique ID classes, of course.

How do you remove slider from view if you use same template ?

Cannot use your theme because dont have your content.

I dont get all. This example from your link is complicated. Can you give some demo example of that you want ? There is 2 ways to do it very easy: - Anchor links in menu and custom ID (I was wrong class wont work) - Use whole header as Extension - Sticky. It was my mistake, this example. Was thinking on something different. All 8 sections need 8 unique ID classes, of course. How do you remove slider from view if you use same template ? Cannot use your theme because dont have your content.

Last edited 29 October 2016 by Stagger Lee

Krav
73 Posts
Krav posted this 29 October 2016

Hi Stagger Lee,
Very much appreciate your time with this.

If it's ok with you, just reply to my email address: order2fontales@orange.fr and I'll send over WP backend plus an example of what would be great to achieve. I'm sure that it is simple to do!

Promise I won't bother your personal email afterwards.

Cheers Krav

Hi Stagger Lee, Very much appreciate your time with this. If it's ok with you, just reply to my email address: order2fontales@orange.fr and I'll send over WP backend plus an example of what would be great to achieve. I'm sure that it is simple to do! Promise I won't bother your personal email afterwards. Cheers Krav
Stagger Lee
1796 Posts
Stagger Lee posted this 29 October 2016

I sent you an email.

I sent you an email.
Stagger Lee
1796 Posts
Stagger Lee posted this 5 weeks ago

Can you make it work ?

It is not so big deal for your developers. Just rename favicon png to favicon.ico and put it in theme root folder. Keep it to the WordPress coding standards.

Do not get it why favicon has to have unique and random filename. it can be only one per website.

Can you make it work ? It is not so big deal for your developers. Just rename favicon png to favicon.ico and put it in theme root folder. Keep it to the WordPress coding standards. Do not get it why favicon has to have unique and random filename. it can be only one per website.
Stagger Lee
1796 Posts
Stagger Lee posted this 5 weeks ago

Here is the code if someone is interessted.
It detect Themler favicon PNG with right name from front-end, and add it to the Head of backend.

function parseFavicon() {


$url = get_bloginfo('url');
$doc = new DOMDocument();
$doc->strictErrorChecking = FALSE;
$doc->loadHTML(file_get_contents($url));
$xml = simplexml_import_dom($doc);
$arr = $xml->xpath('//link[@rel="icon"]');
echo '<link rel="shortcut icon" href="' . $arr[0]['href']. '" type="image/x-icon" />';
}
add_action('admin_head','parseFavicon');
add_action('login_head', 'parseFavicon');

Here is the code if someone is interessted. It detect Themler favicon PNG with right name from front-end, and add it to the Head of backend. function parseFavicon() { $url = get_bloginfo('url'); $doc = new DOMDocument(); $doc->strictErrorChecking = FALSE; $doc->loadHTML(file_get_contents($url)); $xml = simplexml_import_dom($doc); $arr = $xml->xpath('//link[@rel="icon"]'); echo '<link rel="shortcut icon" href="' . $arr[0]['href']. '" type="image/x-icon" />'; } add_action('admin_head','parseFavicon'); add_action('login_head', 'parseFavicon');
Stagger Lee
1796 Posts
Stagger Lee posted this 5 weeks ago

Maybe develoeprs can add it to Themler theme code, and make it work inside Themler editing screen. Developers tend to open and work on many websites at once. So it is very nice visual help, to see what browser tabs belong to what website.

Maybe develoeprs can add it to Themler theme code, and make it work inside Themler editing screen. Developers tend to open and work on many websites at once. So it is very nice visual help, to see what browser tabs belong to what website.
Support Team
Support Team posted this 4 weeks ago

Hi,

The mechanism of uploading and renaming images from file is the same for all parts on the Themler (favicon, image control, background image). Therefore the image will always be renamed.
If you need the file with .ico extension you need to upload exactly .ico file because Themler does not include file converter. There are a lot of ready services. Unfortunately we do not plan to create separate upload image function for favicon at this time.

Thank you,
Olivia

Hi, The mechanism of uploading and renaming images from file is the same for all parts on the Themler (favicon, image control, background image). Therefore the image will always be renamed. If you need the file with `.ico` extension you need to upload exactly `.ico` file because Themler does not include file converter. There are a lot of ready services. Unfortunately we do not plan to create separate upload image function for favicon at this time. Thank you, Olivia
You must log in or register to leave comments