前言介紹
- 這款 WordPress 外掛「Raw HTML」是 2008-01-01 上架。
- 目前有 20000 個安裝啟用數。
- 上一次更新是 2024-11-11,距離現在已有 173 天。
- 外掛最低要求 WordPress 2.8 以上版本才可以安裝。
- 有 33 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
css | html | posts | formatting | javascript |
內容簡介
is capability is only granted to administrators. If you’re not an admin, you will need to ask them to add it to your role.
Raw HTML is not recommended for use on untrusted sites or installations where multiple users can edit posts. Giving untrusted users the ability to add arbitrary HTML, JS or CSS code to your site is a security risk.
If you need to add custom CSS or JS to your site, consider creating a child theme or using a plugin designed specifically for that purpose.
這個外掛讓你可以停用自動格式化功能,例如智慧引號、自動產生段落等等,並且在文章中使用原生的 HTML/JS/CSS 程式碼而不被 WordPress 破壞。
功能
使用這個外掛,你可以將文章中的任何一部分用 [raw]...[/raw] 標籤包起來,以防止 WordPress 將換行符轉換成 HTML 段落,它也不會替換撇號為書法引號等等。如果你需要在文章中添加 CSS 區塊或 JavaScript 程式碼,這特別有用。
RawHTML 還會在「編輯文章」畫面中新增核取方塊,讓你能以文章為單位停用特定 WP 過濾器,例如:
停用 wptexturize(建立智慧引號與其他書法字符的功能)。
停用自動產生段落的功能。
停用網路上的表情符號。
停用 convert_chars(將&符號轉換為 HTML 實體並「修復」某些 Unicode 字元的功能)。
此免費版本僅支援在「文字」標籤(在舊版 WordPress 中稱為「HTML」)編輯文章。如果你想在視覺化編輯模式和文字模式之間切換而不影響文章內容,請使用專業版。
相容性
此外掛不完全支援古鐸堡積木編輯器。在 WordPress 5.0 中,如果使用古典編輯器外掛,某些 Raw HTML 功能可能僅適用。
用法
為了防止 WordPress 篩檢文章或頁面的一部分,請切換到文字/HTML編輯器,然後將它包在[raw]...或...標籤中。這兩種版本的工作方式完全相同,只是後者即使在停用 Raw HTML 時也不會出現在訪問者的畫面中。
範例:
[raw]
This
is
a "test"!
[/raw]
在這種情況下,這些標籤將防止 WordPress 在「This」、「is」和「a “test”」之間插入段落休息,同時確保不將雙引號轉換為書法引號。
為了避免問題,請只在文字/HTML模式下編輯包含自訂程式碼的文章。如果也想使用可視化編輯器,請使用專業版。它會使 [raw] 標籤之間的程式碼在視覺模式下顯示為唯讀佔位符,確保 WordPress 不會更改它。
結合短碼
預設情況下,包含在 [raw] 標籤中的短碼不起作用,只會顯示為純文字。為了啟用這些短碼,請將 shortcodes=1 屬性添加到標籤中:
[raw shortcodes=1]This [shortcode] will be run.[/raw]
[raw]This [shortcode] won't work.[/raw]
在摘要中保留 [raw] 代碼
預設情況下,外掛會自動從文章摘要中刪除任何包含在 [raw]... 標籤中的程式碼。你可以通過將以下行添加到 wp-config.php 中,防止它這麼做:
define('RAW_HTML_KEEP_RAW_IN_EXCERPTS', true);
這確保該外掛不會從自動生成的摘要中刪除 [raw] 區塊。
注意事項
Raw HTML 無法推薦在不受信任的網站或允許多個使用者編輯文章的安裝中使用。允許未受信任的使用者向你的站點添加任意的 HTML、JS 或 CSS 程式碼是一種安全風險。
如果需要在你的站點中添加自定義 CSS 或 JS,請考慮建立子佈景主題或使用專為此目的設計的外掛程式。
原文外掛簡介
Lets you disable automatic formatting like smart quotes and automatic paragraph creation, and use raw HTML/JS/CSS code in your posts without WordPress messing it up.
Features
With this plugin, you can wrap any part of your post in [raw]…[/raw] tags to prevent WordPress from converting newlines to HTML paragraphs, replacing apostrophes with typographic quotes and so on. This is very useful if you need to add a CSS block or JavaScript to your post.
RawHTML will also add new checkboxes to the “Edit Post” screen that let you disable certain WP filters on a per-post basis. This way you can:
Disable wptexturize (the function that creates smart quotes and other typographic characters).
Disable automatic paragraph creation.
Disable image smilies.
Disable convert_chars (the function that converts ampersands to HTML entities and “fixes” some Unicode characters).
The free version only supports editing posts in the Text tab (called “HTML” in older WordPress versions). Get the Pro version if you want to be able to switch between Text and the Visual editor without WordPress messing up your content.
Compatibility
This plugin doesn’t fully support the Gutenberg editor. As of WordPress 5.0, some Raw HTML features will only work if you use the Classic Editor plugin.
Usage
To prevent a part of your post or page from being filtered by WordPress, switch to the Text/HTML editor and wrap it in [raw]...[/raw] or ... tags. These two versions work exactly the same, except that the latter won’t be visible to your visitors even if you deactivate Raw HTML.
Example :
[raw]
This
is
a "test"!
[/raw]
In this case, the tags will prevent WordPress from inserting paragraph breaks between “This”, “is” and “a “test””, as well as ensure that the double quotes arround “test” are not converted to typographic (curly) quotes.
To avoid problems, only edit posts that contain your custom code in Text/HTML mode. If you’d like to be able to also use the Visual editor, get the Pro version. It will make the code betwen [raw] tags appear as a read-only placeholder when viewed in Visual mode, ensuring WordPress doesn’t change it.
Combining shortcodes
By default, shortcodes that are inside [raw] tags will not work. They will just show up as plain text. To enable shortcodes, add the shortcodes=1 attribute to the tag:
[raw shortcodes=1]This [shortcode] will be run.[/raw]
[raw]This [shortcode] won't work.[/raw]
Preserving [raw] code in excerpts
By default, the plugin will automatically remove any code that’s inside [raw]...[/raw] tags from post excerpts. You can prevent that by adding the following line to wp-config.php:
define('RAW_HTML_KEEP_RAW_IN_EXCERPTS', true);
This will ensure that the plugin doesn’t strip [raw] blocks from automatically generated excerpts.
Notes
Some features of Raw HTML will only work for users who have the “unfiltered_html” capability. In a normal WordPress install that includes the Editor and Administrator roles. In a Multisite install, only the Super Admin has this capability by default.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Raw HTML」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.0.2 | 1.0.3 | 1.0.4 | 1.0.5 | 1.2.1 | 1.2.2 | 1.2.3 | 1.2.4 | 1.2.5 | 1.4.1 | 1.4.2 | 1.4.3 | 1.4.4 | 1.4.5 | 1.4.6 | 1.4.7 | 1.4.8 | 1.4.9 | 1.5.1 | 1.6.1 | 1.6.2 | 1.6.3 | 1.6.4 | trunk | 1.4.10 | 1.4.11 | 1.4.12 | 1.4.13 | 1.4.14 | 1.4.15 | 1.4.16 |
延伸相關外掛(你可能也想知道)
WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager 》插入標頭和頁腳 + 完整的 WordPress 代碼片段外掛, WPCode (前稱为 WPBeginner 的 "插入標頭和頁腳")是使用率超过 100 万个网站的 WordPress 代码片段外掛中...。
Code Snippets 》Code Snippets 是在您的網站上運行程式碼片段的簡單,清潔和簡單的方法。它消除了將自定義片段添加到您的佈景主題的 functions.php 檔案的需求。, 現在提供 C...。
Widget CSS Classes 》Widget CSS Classes 可以讓您給 WordPress Widget 添加自定義的 class 和 id, 請注意,此外掛並不支援輸入自定義的 CSS。您需要修改主題的 style.css,或加入...。
Simple Custom CSS Plugin 》無需麻煩地將自訂 CSS 新增到 WordPress 網站中。, 這是一個易於使用的 WordPress 外掛,可以添加自訂 CSS 樣式以覆寫外掛和佈景主題的預設樣式。該外掛旨在...。
Simple CSS 》需要在你的網站中添加自定義 CSS 嗎?Simple CSS 提供一個很棒的管理編輯器和 Customizer 中的即時預覽編輯器,讓你能夠輕鬆添加 CSS。, 想讓你的 CSS 僅應用...。
WP Add Custom CSS 》WP Add Custom CSS 外掛允許您在整個網站及個別文章、頁面和自訂文章類型(例如 Woocommerce 產品)中添加自訂的 CSS。, 對整個網站應用的 CSS 樣式將覆蓋您...。
Visual CSS Style Editor 》Style your WordPress site visually. Discover the most popular front-end design plugin! Try live demo., , Visual CSS Editor, The plugin allows you t...。
WP-SCSS 》此外掛使用 ScssPhp,在 WordPress 安裝中編譯 .scss 檔案。包含設定頁面,可配置目錄、錯誤報告、編譯選項和自動佇列。, 此外掛僅在更改 .scss 檔案時進行編...。
Clear Cache for Me 》Clear Cache For Me 是一個 WordPress 外掛,適用於 W3 Total Cache 和 WP Super Cache,因為它們不知道 widget 何時更新,且在更新 widget 和 menu 時都不會...。
Scripts n Styles 》這個外掛讓管理員用戶能夠將自訂的 CSS 和 JavaScript 直接添加到個別文章、頁面或任何註冊的自訂文章類型中,也可以將類別添加到 body 標籤和文章容器中。還...。
Forget About Shortcode Buttons 》相容於 WordPress 傳統編輯器,Gutenberg 整合即將推出🙂, 歡迎提出功能需求/建議!, 即忘短碼(FASC)按鈕是在所見即所得編輯器中及網站佈景主題中加入 CSS 按...。
Code Embed 》注意: WordPress 5.0 及以上版本的使用者請查看常見問題以了解如何在區塊編輯器中使用此外掛。, Code Embed 外掛允許您在文章中嵌入程式碼(JavaScript 和 H...。
Microthemer Lite – Visual Editor to Customize CSS 》Microthemer是一個輕量級且功能強大的視覺編輯器,可以自訂網站的CSS樣式,從Google字體到響應式佈局,它適用於程式開發人員和非程式開發人員,並與Elementor...。
Core Framework 》總結:Core Framework是一個簡單易用、樂趣滿滿的WordPress外掛,如同你的CSS瑞士軍刀,幫助你輕鬆打造完美網站。, , 問題與答案:, - Core Framework是什麼...。
WP Super Minify • Minify, Compress and Cache HTML, CSS & JavaScript 》這個外掛可以在需要時結合、縮小和緩存內聯的 JavaScript 和 CSS 文件,以加快頁面加載速度,並使用Minify PHP Framework。, 啟用此外掛後,您會發現您的 HTM...。