简体   繁体   English

引导自动生成<p> Wordpress 中的标签</p>

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

Can anyone help me with this?, I use the_content() in my p tag and the bootstrap auto generate more p tag, and even the content did not placed inside the p .任何人都可以帮我解决这个问题吗?我在 p 标签中使用the_content()并且引导程序自动生成更多p标签,甚至内容也没有放在p中。 it is inside another p它在另一个p里面

picture-1:图片1:
在此处输入图像描述

picture-2:图二:
在此处输入图像描述

Because the_content() will always wrap the content with a <p> tag.因为 the_content() 将始终用<p>标记包装内容。

You can use get_the_content() insted of the_content() but using get_the_content() will give you the content without any shortcodes or embedded media as mentioned at codex .您可以使用 get_the_content() insted of the_content() 但使用 get_the_content() 将为您提供没有任何短代码或嵌入媒体的内容,如codex所述。

This is another solution to get exactly what you want:这是获得您想要的东西的另一种解决方案:

<?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