【发布时间】:2016-10-20 14:47:49
【问题描述】:
我使用 Duster 作为我的主题。我想更改默认字体。有什么办法吗?
【问题讨论】:
-
我投票决定将此问题作为离题结束,因为应该在 wordpress 网站上
标签: css wordpress fonts wordpress-theming
我使用 Duster 作为我的主题。我想更改默认字体。有什么办法吗?
【问题讨论】:
标签: css wordpress fonts wordpress-theming
步骤 1 安装插件,然后转到 => 设置 => google fonts 。添加一个 css 选择器,如果您想更改整个网站的字体系列更改,然后添加一个 body css 选择器。
第 2 步 转到 => 外观 => 自定义 => 排版 => 主题排版 => 添加您要使用的字体系列。
【讨论】:
...或者,如果您不喜欢插件,只需执行此操作并在标题中的所有其他样式表之后添加样式表:
body {
font-family:Whatever, "Whatever In Space", sans-serif; /* Actual fonts of course chosen by you */
}
如果这不起作用并被覆盖更改为font-family:Whatever, "Whatever In Space", sans-serif !important;,但使用!important 通常被认为是最后的手段。
【讨论】:
如果您想在不使用任何插件的情况下更改字体,可以按照以下步骤操作:
wp-content->themes->my theme->font 中创建一个字体文件夹。在 CSS 文件的开头,添加以下行:
@font-face {
font-family: 'BYekan';
src: url('font/WebYekan.eot');
src: url('font/WebYekan.eot?#iefix') format('embedded-opentype'),
url('font/WebYekan.woff') format('woff'),
url('font/WebYekan.ttf') format('truetype'),
url('font/WebYekan.svg#WebYekan') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'BKoodakBold';
src: url('font/BKoodakBold.eot');
src: url('font/BKoodakBold.eot?#iefix') format('embedded-opentype'),
url('font/BKoodakBold.ttf') format('truetype');
font-weight: normal;
font-style: normal;
-moz-font-feature-settings: "calt=0,liga=0";
}
将font-family 更改为:
font-family:"BKoodakBold",BKoodak,byekan,Arial,Helvetica Neue,sans-serif;
任何你想改变字体的地方。
【讨论】: