Title: Custom CSS and JS
Author: pjdietz
Published: <strong>2010 年 2 月 5 日</strong>
Last modified: 2010 年 5 月 20 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/custom-css-and-js.svg)

# Custom CSS and JS

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

[下載](https://downloads.wordpress.org/plugin/custom-css-and-js.zip)

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

 [技術支援](https://wordpress.org/support/plugin/custom-css-and-js/)

## 外掛說明

[Custom CSS and JS](http://pjdietz.com/wordpress-plugins/custom-css-js/) allows 
you to add stylesheets and JavaScripts to any individual post by adding custom fields.
Both CSS and scripts can be either internal or external. Since this is a plugin,
the custom CSS and JavaScript are available to any theme used to display the post,
as long as the themes call “wp_head”.

### Using the Plugin

To use the plugin, add any combination of the following custom fields to your post.

**custom_css**
 Add an external stylesheet by adding a custom field with the name**
custom_css**. The value of the field should be the path to your css file.

**cusrom_css_code**
 Add an internal stylesheet by adding a custom field with the
name **custom_css_code**. Include your CSS code as the value. (Do not include the
style tags.)

**custom_js**
 Add an external JavaScript by adding a custom field with the name**
custom_js**. The value of the field should be the path to your script.

**custom_js_code**
 Add an internal JavaScript by adding a custom field with the
name **custom_js_code**. Include your JavaScript code as the value. (Do not include
the script tags.)

### Custom Fields Order

 1. The external styles and scripts are included before the internal ones.
 2. If you include multiple entries for a given field, the entries will be included
    in order.

### Okay, but what if I don’t like those tags?

Just edit custom-css-js.php and change the constants defined near the top of the
file.

### Note

This plugin only works with individual posts and pages. It does not work for list
pages (e.g., the index page, search results).

## 安裝方式

 1. Unpack the download package.
 2. Upload folder to the “/wp-content/plugins/” directory
 3. Activate the plugin through the “Plugins” menu in WordPress

## 使用者評論

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

## 參與者及開發者

以下人員參與了開源軟體〈Custom CSS and JS〉的開發相關工作。

參與者

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

[將〈Custom CSS and JS〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/custom-css-and-js)

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

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

## 中繼資料

 *  版本 **1.0**
 *  最後更新 **16 年前**
 *  啟用安裝數 **900+**
 *  WordPress 版本需求 ** 2.8 或更新版本 **
 *  已測試相容的 WordPress 版本 **2.9.2**
 *  語言
 * [English (US)](https://wordpress.org/plugins/custom-css-and-js/)
 * 標籤:
 * [css](https://tw.wordpress.org/plugins/tags/css/)[javascript](https://tw.wordpress.org/plugins/tags/javascript/)
   [post](https://tw.wordpress.org/plugins/tags/post/)[stylesheet](https://tw.wordpress.org/plugins/tags/stylesheet/)
 *  [進階檢視](https://tw.wordpress.org/plugins/custom-css-and-js/advanced/)

## 評分

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

[Your review](https://wordpress.org/support/plugin/custom-css-and-js/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/custom-css-and-js/reviews/)

## 參與者

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

## 技術支援

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

 [檢視技術支援論壇](https://wordpress.org/support/plugin/custom-css-and-js/)