html - 更改 Wordpress 内容字体

标签 html css wordpress fonts

我正在尝试更改内容 (the_content()) 的字体系列,但是当我用 <P> 包裹它时像这样标记

<p class="naskh"><?php the_content(); ?></p>

当我在 chrome 的开发人员工具上检查它时,内容不在 <P> 中标签,就像这样:

<p class="naskh" lingdex="0"></p>
<p lingdex="1"> the content ...</p>

所以我不能给内容我想要的字体类型。我进行了很多搜索并尝试了许多给定的解决方案,但没有一个对我有用。 怎么办?

最佳答案

不要将您的 the_content() 包装在 p 中。相反,你可以这样做

<div class="someclass">
    <?php the_content(); ?>
</div>

然后在你的css中你可以有这样的东西

.someclass, .someclass p, .someclass h1 {
    font-family: you_custom_font_family, Arial, Helvetica;
}

关于html - 更改 Wordpress 内容字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19358711/

相关文章:

javascript - 选择,然后使用 jQuery 调整具有一定比例的图像

css - 全屏时背景图像被剪切

wordpress - 我网站的 https 被划掉了

css - Wordpress - 如何在排队时对某些样式表进行优先级排序

html - 页面不滚动 HTML CSS

javascript - 将文本框转换为任何其他 html 元素

html - 内容溢出时高度(最小高度)100%不起作用?

html - CSS 变换旋转在我的代码中不起作用

javascript - 使用带有括号的图像 URL 作为 jQuery 的背景

php - 从 Metabox 调用 WordPress Gallery uploader /选择器