WordPress. 如何添加谷歌WEB字体
2014年5月14日
本教程展示了如何添加Google WEB font to a WordPress模板 based on Cherry 框架.
-
在Cherry选项中,我们可以看到一个字体列表. 我们将再添加一种字体.
-
Go to Appearance -> Editor. Open the options.php 要编辑的文件. 搜索以下代码:
$typography_mixed_fonts = array_merge(options_typography_get_os_fonts()) , options_typography_get_google_fonts ());
你通常可以在 // Fonts comment.
-
Open the 谷歌网页字体页面,选择所需字体并将其添加到 集合. 单击 Use button.
-
Open the @import tab 你会看到一个CSS字体导入代码. 在我们的例子中是Domine, serif是字体族.
-
In the options.php 文件中应该添加以下代码:
$typography_mixed_fonts["边框,衬线"]= "边框*";
before:
带点($ typography_mixed_fonts);
-
Open the themeXXXXX /风格.less 文件与任何文本/代码 editor. 复制@import代码并粘贴到样式的开头.less file. 保存更改并上传修改后的文件,替换原来的文件.
-
刷新页面. 我们添加了一个Google 网页字体. 现在你可以在Cherry字体选项下看到它.
在这段代码中 “老爷,衬线” 是字体族, “老爷*” 是字体名称,将出现在樱桃选项. 修改后的文件应该与 截图 below. 保存更改.
请随时查看下面的详细视频教程: