每当我在 WordPress 帖子页面中发布一些内容时,它都会显示一些段落标签,例如 <p>
和<br/>
。这在输出中显示了一些额外的空间。那么有没有什么解决办法呢?如何删除所有标签?
最佳答案
发生这种情况是因为 WordPress 的 wpautop
。
只需在主题的functions.php 文件中添加以下代码行
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
了解更多信息:http://codex.wordpress.org/Function_Reference/wpautop
关于wordpress - 删除 WordPress 帖子中的 <p> 和 <br/> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6625458/