簡體   English   中英

引導自動生成<p> Wordpress 中的標簽</p>

[英]Bootstrap auto generate <p> tag in Wordpress

任何人都可以幫我解決這個問題嗎?我在 p 標簽中使用the_content()並且引導程序自動生成更多p標簽,甚至內容也沒有放在p中。 它在另一個p里面

圖片1:
在此處輸入圖像描述

圖二:
在此處輸入圖像描述

因為 the_content() 將始終用<p>標記包裝內容。

您可以使用 get_the_content() insted of the_content() 但使用 get_the_content() 將為您提供沒有任何短代碼或嵌入媒體的內容,如codex所述。

這是獲得您想要的東西的另一種解決方案:

<?php
$content = get_the_content();
$content = apply_filters('the_content', $content);
$replace = '<p class="discription">';
echo str_replace('<p>', $replace, $content ); ?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM