首页 文章

Wordpress删除那些自动生成的<p>标记

提问于
浏览
0

我想删除那些wordpress正在自动生成的 <P> 标签 .

我有谷歌,并得到解决方案,如删除过滤器

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

但是通过使用它,它删除了我已经在页面内容中使用的所有 <p> 标签 .

例如 :

当我在页面内容中添加纯文本时

This is example.

Wordpress在 <p> 标签中包装这些纯文本,如 <P>This is example.</p>

如何停止添加 <p> 标记而不是删除所有 <p> 标记 .

3 回答

  • 0

    尝试这个,它将为微粒页面删除额外的 <p>

    http://wordpress.org/plugins/ps-disable-auto-formatting/

    配置此插件后,您将获得这样的选项,在示例站点上显示

    http://www.wordpress-plugin.net/remove-automatic-p-paragraph-in-wordpress/

  • 0

    使用strip_tags()函数,这将对您有所帮助

  • 0

    wordpress中的一个好插件是:

    Row Html

    这个插件的功能是:

    • 禁用wptexturize(创建智能引号和其他印刷字符的功能) .

    • Disable automatic paragraph creation.

    • 禁用图像表情符号 .

    • 禁用convert_chars(将&符号转换为HTML实体的函数和"fixes"某些Unicode字符) .

相关问题