admin管理员组文章数量:1323317
I am editing the theme Peggi () over a child theme to make it GDPR compliant. I managed to remove all external resources like google fonts, except one:
<link href="+Sans:400%7CRoboto:400%7CFira+Sans:500" rel="stylesheet" property="stylesheet" media="all" type="text/css" >
This link has not been enqueued via wp_enqueue_style and I cannot find it anywhere in the code. I do not know where this line of code comes from. I need to remove it anyway.
Is there a possibility to remove it within functions.php of my child theme anyhow? Javascript is not a solution as it fires after the page is loaded; it has to be removed within PHP.
Thanks!
I am editing the theme Peggi (https://themeforest/item/peggi-a-multipurpose-wordpress-children-theme/22094659) over a child theme to make it GDPR compliant. I managed to remove all external resources like google fonts, except one:
<link href="https://fonts.googleapis/css?family=Open+Sans:400%7CRoboto:400%7CFira+Sans:500" rel="stylesheet" property="stylesheet" media="all" type="text/css" >
This link has not been enqueued via wp_enqueue_style and I cannot find it anywhere in the code. I do not know where this line of code comes from. I need to remove it anyway.
Is there a possibility to remove it within functions.php of my child theme anyhow? Javascript is not a solution as it fires after the page is loaded; it has to be removed within PHP.
Thanks!
Share Improve this question asked Sep 2, 2020 at 7:01 toneyttoneyt 416 bronze badges1 Answer
Reset to default 0This looks like google font imports via the theme options, are you sure that this font is not selected anywhere inside the theme's options, a page template, a plugin or the themes' functions.php file? It MUST be in one of those locations. If you can't find it, use this (you gotta find out the handle for this, and there are different ways to do so, for example like this)
EDIT: Dequeue_style probably won't work, as this is not a proper stylesheet being enqueued (which you can verify by checking the handles of enqueued stylesheets as described above). Focus on finding out where it comes from, it must be one of the options above; and simply remove it from there. You may also check the mentioned possible sources for the parent theme. So, what I would do is:
Check both the functions.php file of the parent and the child theme for google font imports.
Check page templates of both for google font imports (check if the font is present on all or just on specific pages, this could help you in limiting your search).
Inactivate plugins one by one and check if the style is still present or not.
本文标签: child themeRemove Stylesheet by URL that has not been enqueued
版权声明:本文标题:child theme - Remove Stylesheet by URL that has not been enqueued 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742143174a2422673.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论