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

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的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://cn.wordpress.org/plugins/custom-css-and-js/#description)
 * [评价](https://cn.wordpress.org/plugins/custom-css-and-js/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/custom-css-and-js/#installation)
 * [开发进展](https://cn.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 或更高版本 **
 *  已测试的最高版本为 **2.9.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/custom-css-and-js/)
 * 标签
 * [css](https://cn.wordpress.org/plugins/tags/css/)[javascript](https://cn.wordpress.org/plugins/tags/javascript/)
   [post](https://cn.wordpress.org/plugins/tags/post/)[stylesheet](https://cn.wordpress.org/plugins/tags/stylesheet/)
 *  [高级视图](https://cn.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/)