0

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

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

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

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

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

4

2 回答 2

0

不要包裹你the_content()p。相反,你可以这样做

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

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

.someclass, .someclass p, .someclass h1 {
    font-family: you_custom_font_family, Arial, Helvetica;
}
于 2013-10-14T11:02:16.183 回答
0

这不应该是技术问题:

wordpress 默认使用过滤文本。要删除过滤器,您可以使用 wordpress 的功能

你可以写下面的代码

remove_filter( 'the_content', 'wpautop' ); 

代替

<?php the_content(); ?>

它将删除您自动生成的<p>标签。

谢谢

于 2013-10-14T12:11:14.720 回答