跳至主要內容
找不到符合的
程式技術筆記
  • VueJS
  • Shopify
  • Laravel
  • PHP
  • WordPress
程式技術筆記

WordPress 文章內的 br 元素被 wpautop 吃掉時該如何解決?

  • EditorEditor
  • 19 2 月, 2024
  • WordPress

將 wpautop 關閉

function custom_disable_wpautop_for_posts($content) {
  global $post;

  if (is_single()) {
    remove_filter('the_content', 'wpautop');
    remove_filter('the_excerpt', 'wpautop');
  }

  return $content;
}
add_filter('the_content', 'custom_disable_wpautop_for_posts', 0);
延伸推薦
WordPress CookieYes 增加翻譯語言
如何繞過 WPForm 的 License 檢驗機制?
綠界定期定額訂閱外掛拆解
Related posts:
  1. 如何在 WordPress 透過外掛安裝 Google Analytics
  2. WordPress Elementor 主題建構器,如何用程式判斷頁面的類型?
  3. WordPress ACF 的 Checkbox 欄位資料轉移到 ACF Taxonomy 欄位
  4. WordPress Multi Site 多站點網路是什麼?簡易設定教學

最新文章

  • WordPress CookieYes 增加翻譯語言
  • 如何繞過 WPForm 的 License 檢驗機制?
  • 什麼是瀏覽器錨點(anchor)?怎麼滑動到畫面的特定地方?
  • 綠界定期定額訂閱外掛拆解
  • Woocommerce Subscription 分析

文章分類

  • AI 人工智慧
  • computer science
  • crawler
  • CSS
  • Data Structure
  • DevOps
  • Docker
  • Flutter
  • GA4
  • Git
  • GTM
  • iOS
  • JavaScript
  • Laravel
  • MySQL
  • NFT
  • Nuxt
  • PHP
  • Python
  • SEO
  • Shopify
  • VueJS
  • WordPress
  • 數位行銷
  • 未分類
  • 機器學習
  • 演算法
  • 網頁前端基礎
  • 虛擬主機
  • 資料庫
  • 資訊安全
  • 資訊管理

其他知識

  • 健康相關知識
  • 結婚相關知識
  • 保養美妝相關知識
  • 國外留學相關資訊
  • 長照ABC相關資訊
  • 數位行銷研究室

版權 © 程式技術筆記 since 2019 - 2025