fontello没有在wordpress下划线主题上工作

时间:2016-02-16 19:19:53

标签: php css wordpress fontello

我遇到了Fontello的问题 - everythink正在研究localhost,但是当我在服务器上上传主题(基于下划线创建)时它无法正常工作(实际上它适用于主页 - 设置为启动时) wordpress - bot不在其他人身上。)

您可以在我的测试域webblaster.pl上查看。

主页面没问题 - 在左下方有固定的“社交媒体”栏 - 尚未设置样式 - 这就是为什么它看起来如此丑陋:))

但是在底部的->fotografia-home -> kontakt上,您可以看到一些未正确加载的字体。

在头部我使用以下方法附加css文件:

<link href="<?php bloginfo('stylesheet_directory'); ?>/fonts/fontello/css/fontello.css" rel="stylesheet" type="text/css">

我不知道出了什么问题 - 试图改变目录,但这不起作用。

我将不胜感激任何帮助:)

1 个答案:

答案 0 :(得分:0)

似乎有些css规则会相互覆盖。

/wp-content/themes/paulinakozan/fonts/fontello/css/fontello.css中有一条规则:

[class^="icon-"]::before, [class*=" icon-"]::before {
    display: inline-block;
    font-family: "fontello"; // <-- IMPORTANT LINE!
    font-style: normal;
    font-variant: normal;
    font-weight: normal;
    line-height: 1em;
    margin-left: 0.2em;
    margin-right: 0.2em;
    text-align: center;
    text-decoration: inherit;
    text-transform: none;
    width: 1em;
}

但是您的网站加载了另一个css:/wp-content/plugins/modula-best-grid-gallery/scripts/modula.css?ver=4.4.2并且还有另一条规则:

[class^="icon-"]::before, [class*=" icon-"]::before {
    font-family: "modula-icons" !important; // <-- ANOTHER IMPORTANT LINE!
    font-style: normal !important;
    font-variant: normal !important;
    font-weight: normal !important;
    line-height: 1;
    text-transform: none !important;
}

第二个字体系列定义modula-icons被定义为!important,因此它胜过fontello! 这就是为什么没有正确加载图标的原因。这些图标根本不存在于modula-icons中。

如果我在chrome中打开您的网站并禁用开发人员工具栏中的modula-icons规则,则会正确显示社交图标。

enter image description here