简体   繁体   English

嵌入式字体在Wordpress样式表上不起作用

[英]Embedded Fonts Not Working on Wordpress Stylesheet

I've been trying to add some embedded fonts to the styles.css file of a theme and for some reason I can't seem to get the fonts to work. 我一直在尝试向主题的styles.css文件中添加一些嵌入式字体,由于某种原因,我似乎无法使这些字体正常工作。 The code I have currently is: 我目前拥有的代码是:

@font-face {
    font-family: 'borisblackboxxregular';
    src: url('http://blog.abstract-thinking.co.uk/fonts/borisblackboxxregular/borisblackbloxx-webfont.eot');
    src: url('http://blog.abstract-thinking.co.uk/fonts/borisblackboxxregular/borisblackbloxx-webfont.eot?#iefix') format('embedded-opentype'),
    url('http://blog.abstract-thinking.co.uk/fonts/borisblackboxxregular/borisblackbloxx-webfont.woff') format('woff'),
    url('http://blog.abstract-thinking.co.uk/fonts/borisblackboxxregular/borisblackbloxx-webfont.ttf') format('truetype'),
    url('http://blog.abstract-thinking.co.uk/fonts/borisblackboxxregular/borisblackbloxx-webfont.svg') format('svg');
}

However I've also tried (just one line as an example): 但是我也尝试过(仅以一行为例):

src: url('/fonts/borisblackboxxregular/borisblackbloxx-webfont.eot');
src: url('.../fonts/borisblackboxxregular/borisblackbloxx-webfont.eot');
src: url('borisblackbloxx-webfont.eot');

The physical location for the fonts is in several places, the root folder of the install, in a fonts/borisblackboxxregular folder structure and in the root of the currently applied theme. 字体的物理位置在多个位置,即安装的根文件夹,fonts / borisblackboxxregular文件夹结构和当前应用的主题的根中。 Does anybody know what I might be doing wrong? 有人知道我可能做错了吗?

Thanks to anyone who can answer this. 感谢任何可以回答这个问题的人。

You have some font settings option in the theme, that produce: 您在主题中有一些字体设置选项,它会产生:

h1, h2, h3, h4, h5, h6, h7 {
    font-family: "header-font"!important;
}

This code is coming from your theme's settings page. 此代码来自您主题的设置页面。 There is two options for you to fix it. 有两个选项可以解决。

  1. You can go to the theme's php code and remove the font style. 您可以转到主题的php代码并删除字体样式。
  2. You can override by writing following css in footer.php before closing <body> tag. 您可以在关闭<body>标记之前在footer.php中编写以下CSS来覆盖。

    h1, h2, h3, h4, h5, h6, a { font-family: 'borisblackboxxregular' !important; h1,h2,h3,h4,h5,h6,{{font-family:'borisblackboxxregular'!important; } }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM