【问题标题】:Wordpress Prevent Auto Formating Not WorkingWordpress 防止自动格式化不起作用
【发布时间】:2013-11-14 18:23:56
【问题描述】:

我已尝试让 WordPress 3.7.1 停止自动格式化:

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

但它不起作用!我做错了什么?

** 编辑 **

在functions.php中添加;

在 Bootstrap 3.0.2 中使用自定义主题

插件活动:

  • Timely 的多合一活动日历
  • 企业目录插件
  • 企业目录插件 - Google 地图模块
  • 显示小部件
  • 重力形式
  • 终极 TinyMCE
  • 小部件工具包
  • WooCommerce
  • WP 编辑器 所见即所得的小部件

乍得

【问题讨论】:

  • remove_filter() 是禁用 wpautop 的公认解决方案。我们需要更多信息来回答您的情况,特别是您将代码放在哪里?您的主题中的functions.php?自定义插件?一个投递?

标签: wordpress


【解决方案1】:

创建一个页面模板文件。在您的模板文件中,添加:

remove_filter( 'the_content', 'wpautop' );

到您的页面模板文件(例如,my_template.php),在此行上方的行中:

<?php the_content(); ?>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-24
    • 1970-01-01
    相关资源
    最近更新 更多