我有一个简短的描述,但当我试图显示描述wordpress添加<p>
或<br>
或<strong>
,如何删除?看看这张照片:
我的代码是这样的:
</span>
<span class="address-place">
<?php echo the_excerpt (); ?>
<hr>
</span>
strip_tags
似乎是你正在寻找的:
<?php echo strip_tags(the_excerpt()); ?>
<?php
$myExcerpt = get_the_excerpt();
$tags = array("<p>", "</p>");
$myExcerpt = str_replace($tags, "", $myExcerpt);
?>
</span>
<span class="address-place">
<?php echo $myExcerpt; ?>
<hr>
</span>
答案就在这里。也许对某人有用。 get_the_excerpt()