2013-10-14 44 views
0

我試圖改變內容的字體家族(the_content()),但是當我用<P>標籤這樣更改WordPress的內容字體

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

包裹它,當我檢查它的開發工具在Chrome的內容是不<P>標籤內,這就像:

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

,所以我不能給內容的字體類型我想要的。我搜查了很多,並嘗試了許多給定的解決方案,但其中沒有一個爲我工作。 怎麼辦?

回答

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; 
} 
0

這不應該是技術ANS:

WordPress使用過濾默認文本。 去除過濾器,你可以使用WordPress的功能

你可以寫下面的代碼

remove_filter('the_content', 'wpautop'); 

,而不是

<?php the_content(); ?> 

它會刪除你的自動生成<p>標籤。

謝謝