admin管理员组文章数量:1200344
I'm seeing a weird issue where my site's favicon is not loaded until I accept cookies on a cookie plugin. I wrote the plugin and as far as I know there is no tie of a favicon to cookies and the plugin doesn't explicitly block anything by default. I don't think the favicons are tied to a cookie anyways. Anyone seen this type of behavior before and know how to allow the favicon to load.
Plugin Github
I'm seeing a weird issue where my site's favicon is not loaded until I accept cookies on a cookie plugin. I wrote the plugin and as far as I know there is no tie of a favicon to cookies and the plugin doesn't explicitly block anything by default. I don't think the favicons are tied to a cookie anyways. Anyone seen this type of behavior before and know how to allow the favicon to load.
Plugin Github
Share Improve this question asked Feb 8, 2022 at 21:48 Hunter NelsonHunter Nelson 1487 bronze badges 4- How was the favicon added? Using WordPress? Or by adding a favicon.ico file? Something else? – Jacob Peattie Commented Feb 8, 2022 at 23:27
- have you checked your browsers dev tools for errors? How are you loading the favicon? – Tom J Nowell ♦ Commented Feb 9, 2022 at 0:10
- No errors or messages. The favicon loads fine after I accept or deny cookies and refresh the page, just not before. – Hunter Nelson Commented Feb 11, 2022 at 7:53
- I am using native WordPress favicon loads. I uploaded the favicon through the customizer and I've also put a link to the file in the HTML for the page. – Hunter Nelson Commented Mar 14, 2022 at 1:52
1 Answer
Reset to default 0I figured out the issue. In my plugin I was calling an echo
statement from a WP_Head
function. This was causing the <head>
tag to be immediately closed and rendered in the body. Any remaining code for the WP_Head
was being output in the body, including the favicon <link>
tags.
本文标签: Favicon not loading until cookies are accepted
版权声明:本文标题:Favicon not loading until cookies are accepted? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738550774a2097324.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论