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

Custom CSS and JS

描述

Custom CSS and 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

評價

There are no reviews for this plugin.

貢獻者及開發者

“Custom CSS and JS” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Custom CSS and JS 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄