Title: Xhtheme Code Block
Author: xhtheme
Published: <strong>2025 年 2 月 6 日</strong>
Last modified: 2025 年 9 月 3 日

---

搜尋外掛

![](https://s.w.org/plugins/geopattern-icon/xhtheme-code-block.svg)

# Xhtheme Code Block

 由 [xhtheme](https://profiles.wordpress.org/xhtheme/) 開發

[下載](https://downloads.wordpress.org/plugin/xhtheme-code-block.1.0.2.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/xhtheme-code-block/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/xhtheme-code-block/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/xhtheme-code-block/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/xhtheme-code-block/#developers)

 [技術支援](https://wordpress.org/support/plugin/xhtheme-code-block/)

## 外掛說明

Xhtheme Code Block is a plugin for adding code blocks to your WordPress site, supporting
syntax highlighting and adapting to the theme’s light and dark mode switching.

 * Supports syntax highlighting for multiple programming languages.
 * Allows selection of light, dark, or auto mode.
 * Supports custom filename display.

### External Libraries

 * **Alpine.js**:
    - Version: 3.x.x
    - Source: [Alpine.js Official Website](https://alpinejs.dev/)
    - Description: Alpine.js is a lightweight JavaScript framework for adding interactivity
      to HTML. It is used in the Xhtheme Code Block plugin to manage the reactive
      state of the settings page, allowing for dynamic updates and user interactions
      without the need for page reloads.
 * **Prism.js**:
    - Version: 1.x.x
    - Source: [Prism.js Official Website](https://prismjs.com/)
    - Description: Prism.js is a lightweight, extensible syntax highlighter, built
      with modern web standards in mind. It is used in the Xhtheme Code Block plugin
      to provide syntax highlighting for a wide range of programming languages.

### Source Code

The source code for `build/index.js` can be found in the `block-code/src` directory.

## 適用於區塊編輯器

這個外掛提供 1 個可供 Gutenberg/區塊編輯器使用的區塊。

 *   Code Block A customizable code block component for displaying and editing code
   snippets with syntax highlighting.

## 安裝方式

 1. Upload the `xhtheme-code-block` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. Configure the plugin options under ‘Settings’ -> ‘Xhtheme Code Block’.

## 常見問題集

### What languages are supported?

The Code Syntax Block plugin uses the Prism autoloader plugin to support all of 
the languages Prism supports. See the [list of supported languages here](https://prismjs.com/#supported-languages).

### How do I switch the display mode of the code block?

You can select light, dark, or auto mode on the plugin settings page.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Xhtheme Code Block〉的開發相關工作。

參與者

 *   [ xhtheme ](https://profiles.wordpress.org/xhtheme/)

[將〈Xhtheme Code Block〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/xhtheme-code-block)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/xhtheme-code-block/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/xhtheme-code-block/)，或透過
[RSS](https://plugins.trac.wordpress.org/log/xhtheme-code-block/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/xhtheme-code-block/)。

## 變更記錄

#### 1.0.2

Compatible with WordPress 6.8

#### 1.0.1

Fixed potential data sanitization issues.

#### 1.0

 * Initial release.

## 中繼資料

 *  版本 **1.0.2**
 *  最後更新 **10 個月前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 5.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.8.5**
 *  PHP 版本需求 ** 7.2 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/xhtheme-code-block/)
 * 標籤:
 * [block](https://tw.wordpress.org/plugins/tags/block/)[code](https://tw.wordpress.org/plugins/tags/code/)
   [dark mode](https://tw.wordpress.org/plugins/tags/dark-mode/)[gutenberg](https://tw.wordpress.org/plugins/tags/gutenberg/)
   [syntax highlighting](https://tw.wordpress.org/plugins/tags/syntax-highlighting/)
 *  [進階檢視](https://tw.wordpress.org/plugins/xhtheme-code-block/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/xhtheme-code-block/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/xhtheme-code-block/reviews/)

## 參與者

 *   [ xhtheme ](https://profiles.wordpress.org/xhtheme/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/xhtheme-code-block/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://paypal.me/xhtheme)