Title: Insert JavaScript and CSS
Author: Ryan
Published: <strong>22 Tháng 6, 2012</strong>
Last modified: 26 Tháng 7, 2012

---

Tìm kiếm plugin

Plugin này **chưa được cập nhật với 3 phiên bản mới nhất của WordPress**. Nó có 
thể không được hỗ trợ và bảo trì, và có thể xung đột với các phiên bản WordPress
mới nhất.

![](https://s.w.org/plugins/geopattern-icon/insert-javascript-css.svg)

# Insert JavaScript and CSS

 Bởi [Ryan](https://profiles.wordpress.org/ryannutt/)

[Tải về](https://downloads.wordpress.org/plugin/insert-javascript-css.0.2.zip)

 * [Chi tiết](https://vi.wordpress.org/plugins/insert-javascript-css/#description)
 * [Đánh giá](https://vi.wordpress.org/plugins/insert-javascript-css/#reviews)
 *  [Cài đặt](https://vi.wordpress.org/plugins/insert-javascript-css/#installation)
 * [Nhà phát triển](https://vi.wordpress.org/plugins/insert-javascript-css/#developers)

 [Hỗ trợ](https://wordpress.org/support/plugin/insert-javascript-css/)

## Mô tả

Easily add custom JavaScript or CSS to a single post or page.

When activated, a new icon is added to the post edit page near the icon you use

to add media to a post. Clicking the new icon brings up a screen where you can insert
JavaScript and CSS that will be included with the current post.

Anything entered into the text field on the JavaScript tab will be inserted into

the <head> section of your web page. Same is true of the CSS tab. This allows you
to insert arbitrary JavaScript and CSS into any post or page you would like without
having to resort to loading it on all pages.

## Ảnh màn hình

[⌊Icon added to the post media area⌉⌊Icon added to the post media area⌉[

Icon added to the post media area

[⌊Form to enter JavaScript⌉⌊Form to enter JavaScript⌉[

Form to enter JavaScript

[⌊Form to enter CSS⌉⌊Form to enter CSS⌉[

Form to enter CSS

## Cài đặt

 1. Upload the `insert-javascript-css` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

OR

 1. Use the plugin installer inside of WordPress

## Hỏi đáp

  Do I need to wrap in script or style tags?

Does’t matter. If you do, they’re left in place. If you don’t, they’ll be added.

  What about archive pages?

Unless you specifically tell it not to, this plugin will include any JavaScript 
or CSS
 included in a post on archive pages as well.

This can lead to conflicts. Take for example two posts, one with `body { background:
blue; }`
 and the other with `body { background: green; }`. Whichever post comes
last will take priority, but that’s probably not what you want.

If you add a custom field named `ijsc_single_only` to your post the JavaScript or
CSS will
 only add when `is_single()` is true. It doesn’t matter what value you 
put in `ijsc_single_only`, only that there is a value.

  Who can insert JavaScript or CSS

By default users with the capability upload_files are allowed to insert JavaScript

or CSS into posts. This seemed to be a logical choice as you need to have a certain
level of trust for users to upload files.

If you would like to change what capability is required you can edit the `IJC_CAPABILITY_REQUIRED`

constant defined in `insert-javascript-css.php` inside the plugin folder.

## Đánh giá

![](https://secure.gravatar.com/avatar/20eed4d0ae64e466d8d9597de8f63a2b8333d4ef9c5d3fc4b79b83d451235232?
s=60&d=retro&r=g)

### 󠀁[Another awesome WP plugin](https://wordpress.org/support/topic/another-awesome-wp-plugin/)󠁿

 [fpats](https://profiles.wordpress.org/fpats/) 7 Tháng 2, 2017

Not.

 [ Đọc tất cả 10 đánh giá ](https://wordpress.org/support/plugin/insert-javascript-css/reviews/)

## Người đóng góp & Lập trình viên

“Insert JavaScript and CSS” là mã nguồn mở. Những người sau đã đóng góp vào plugin
này.

Những người đóng góp

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

[Dịch “Insert JavaScript and CSS” sang ngôn ngữ của bạn.](https://translate.wordpress.org/projects/wp-plugins/insert-javascript-css)

### Muốn tham gia phát triển?

[Duyệt code](https://plugins.trac.wordpress.org/browser/insert-javascript-css/),
check out [SVN repository](https://plugins.svn.wordpress.org/insert-javascript-css/),
hoặc theo dõi [nhật ký phát triển](https://plugins.trac.wordpress.org/log/insert-javascript-css/)
qua [RSS](https://plugins.trac.wordpress.org/log/insert-javascript-css/?limit=100&mode=stop_on_copy&format=rss).

## Nhật ký thay đổi

#### 0.2

Fix so CSS and JS will show up in post types other than post.

#### 0.1

Initial release

## Meta

 *  Phiên bản **0.2**
 *  Cập nhật lần cuối **14 năm trước**
 *  Số lượt cài đặt **400+**
 *  Phiên bản WordPress ** 3.0 hoặc cao hơn **
 *  Đã kiểm tra lên đến **3.4.2**
 *  Ngôn ngữ
 * [English (US)](https://wordpress.org/plugins/insert-javascript-css/)
 * Thẻ
 * [css](https://vi.wordpress.org/plugins/tags/css/)[javascript](https://vi.wordpress.org/plugins/tags/javascript/)
   [page](https://vi.wordpress.org/plugins/tags/page/)[post](https://vi.wordpress.org/plugins/tags/post/)
 *  [Nâng cao](https://vi.wordpress.org/plugins/insert-javascript-css/advanced/)

## Đánh giá

 4.1 trên 5 sao.

 *  [  7 5-star reviews     ](https://wordpress.org/support/plugin/insert-javascript-css/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/insert-javascript-css/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/insert-javascript-css/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/insert-javascript-css/reviews/?filter=2)
 *  [  2 1-star reviews     ](https://wordpress.org/support/plugin/insert-javascript-css/reviews/?filter=1)

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

[Xem tất cả đánh giá](https://wordpress.org/support/plugin/insert-javascript-css/reviews/)

## Những người đóng góp

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

## Hỗ trợ

Có điều gì muốn nói? cần giúp đỡ?

 [Xem diễn đàn hỗ trợ](https://wordpress.org/support/plugin/insert-javascript-css/)

## Ủng hộ

Bạn có muốn hỗ trợ vào sự phát triển của plugin này?

 [ Ủng hộ plugin này ](http://www.nutt.net/donate/)