gpt4 book ai didi

wordpress - 在wordpress中编辑帖子时如何设置指定的字体系列?

转载 作者:行者123 更新时间:2023-12-04 21:03:31 25 4
gpt4 key购买 nike

我创建了一个子主题,将 font-family 设置为我想要的 DejaVu Sans Mono对于每个 html 元素。

vim /var/www/html/wp-content/themes/twentyfourteen-child/style.css
*{
font-family:"DejaVu Sans Mono" !important;
}

我用 twentyfourteen-child作为我的 wordpress 主题。
每个处于编辑状态的字符都不是 DejaVu Sans Mono .
enter image description here

帖子中的每个字符都是 DejaVu Sans Mono发表后。
enter image description here

如何将字体系列设置为 DejaVu Sans Mono什么时候编辑帖子?

最佳答案

如果你改变/var/www/html/wp-content/themes/twentyfourteen-child/style.css 这个文件
这将仅在您的主题文件上实现。您的 font-family 属性仅适用于主题文件夹相关文件。

那么如何处理管理面板 css 呢?

第1步

你可以把 CSS 文件放在任何你想要的地方;我选择将 CSS 文件放在我的主题中。我的管理 CSS 文件如下所示:

*{
font-family:"DejaVu Sans Mono" !important;
}


第2步

WordPress 使用 add_action 类型的 admin_enqueue_scripts 在 WordPress 内的任何地方添加样式表:

 // Update CSS within in Admin (functions.php)
function admin_style() {
wp_enqueue_style('admin-styles', get_template_directory_uri().'/admin.css');
}
add_action('admin_enqueue_scripts', 'admin_style');


get_template_directory_uri 提供当前主题的路径,您只需将文件名添加到路径的末尾。

如果您对像我这样的 WordPress 管理员样式感到恼火,请随时加入并更改它们。我的更新非常简单;如果您想彻底修改 WordPress 主题,让您的客户认为他们正在获得一个完全定制的系统,请随意这样做!

关于wordpress - 在wordpress中编辑帖子时如何设置指定的字体系列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52983895/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com