Title: Post/Page Specific Custom Code
Author: Łukasz Nowicki
Published: <strong>16 دسامبر 2016</strong>
Last modified: 23 جولای 2026

---

جستجوی افزونه‌ها

![](https://ps.w.org/postpage-specific-custom-css/assets/banner-772x250.png?rev=
2292438)

![](https://ps.w.org/postpage-specific-custom-css/assets/icon-256x256.png?rev=1707637)

# Post/Page Specific Custom Code

 توسط [Łukasz Nowicki](https://profiles.wordpress.org/lukasznowicki/)

[دانلود](https://downloads.wordpress.org/plugin/postpage-specific-custom-css.0.3.1.zip)

 * [جزئیات](https://fa.wordpress.org/plugins/postpage-specific-custom-css/#description)
 * [نقد و بررسی‌ها](https://fa.wordpress.org/plugins/postpage-specific-custom-css/#reviews)
 *  [نصب](https://fa.wordpress.org/plugins/postpage-specific-custom-css/#installation)
 * [توسعه](https://fa.wordpress.org/plugins/postpage-specific-custom-css/#developers)

 [پشتیبانی](https://wordpress.org/support/plugin/postpage-specific-custom-css/)

## توضیحات

Post/Page Specific Custom Code lets you add custom CSS to individual posts, pages,
or WooCommerce products. A dedicated box on the edit screen is where you write your
CSS. You can also choose whether it should load only on the single view or on archive-
style views as well.

The meta box appears below the content editor for posts, pages, and products. Enter
your CSS there and decide whether it applies only on the single view or also on 
archive-style views (blog/category listings, the WooCommerce shop and product categories/
tags). Product CSS also loads on a best-effort basis for products rendered through
standard WooCommerce loop templates outside the main query (for example the `[products]`
shortcode). CSS discovered only after the page head may be printed in the footer.
Custom product markup that skips WooCommerce templates needs a small integration
hook. Products injected only via AJAX or infinite scroll are not covered.

CSS fields use a code editor with syntax highlighting by default. You can turn highlighting
off with a filter if you prefer a plain textarea (for example on slower machines).

### Requirements

This plugin requires WordPress 5.0 or later (please keep WordPress up to date) and
PHP 7.4 or later on your server.

## عکس‌های صفحه

[⌊If you do not see the Custom Code panel, open Screen Options and make sure "Custom
Code" is checked.⌉⌊If you do not see the Custom Code panel, open Screen Options 
and make sure "Custom Code" is checked.⌉[

If you do not see the Custom Code panel, open Screen Options and make sure “Custom
Code” is checked.

[⌊Enter CSS that applies to your post, page, or product. You can limit it to the
single view only.⌉⌊Enter CSS that applies to your post, page, or product. You can
limit it to the single view only.⌉[

Enter CSS that applies to your post, page, or product. You can limit it to the single
view only.

[⌊Plugin settings screen.⌉⌊Plugin settings screen.⌉[

Plugin settings screen.

## نصب

#### Automatic installation

Automatic installation is the easiest option. Log in to your WordPress admin, go
to Plugins, and click Add New.

Search for _Post/Page Specific Custom Code_, then click Install Now.

#### Manual installation

 1. Download the plugin ZIP from WordPress.org (or from this repository).
 2. Upload the `postpage-specific-custom-css` folder to the `/wp-content/plugins/` 
    directory (so the main plugin file is at `/wp-content/plugins/postpage-specific-
    custom-css/post-page-specific-custom-css.php`).
 3. Activate the plugin through the Plugins menu in WordPress.
 4. That’s it — enjoy!

## سوالات متداول

### Is it free?

Yes. It is licensed under GPLv2 (or later). If you would like to support the work,
you are welcome to donate — thank you!

### How do I disable CSS code highlighting in the editor?

Highlighting is on by default. To use a plain textarea instead, add this to your
theme’s `functions.php` or a small custom plugin:

    ```
    add_filter( 'postpage_sccss-highlight_code', '__return_false' );
    ```

This affects the Custom Code box on posts, pages, and products, and the default 
CSS fields on the plugin settings screen. Disabling highlighting uses a plain textarea.
On posts, pages, and products, automatic syntax checking still runs for that textarea;
the default CSS fields on the plugin settings screen do not have syntax checking.

### How do I load product CSS for a custom product loop?

If your theme or plugin renders products with the standard WooCommerce templates(`
wc_product_class()` / `content-product.php`), registration is automatic. If you 
output your own HTML, register the product before rendering it:

    ```
    do_action( 'postpage_sccss_register_product', $product_id );
    ```

You may pass a product ID, a `WP_Post`, or a `WC_Product` instance.

## نقد و بررسی‌ها

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

### 󠀁[Spam message asking for money](https://wordpress.org/support/topic/spam-message-asking-for-money/)󠁿

 [brandoncollins](https://profiles.wordpress.org/brandoncollins/) 3 می 2024

Be warned! This plugin is a sneaky scam. Out of nowhere, a giant info box shoves
a payment message in your face on the WordPress admin page. It’s clear the developer
has no clue about user experience, and leaving their code on your site is a recipe
for disaster.

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

### 󠀁[Spammy plugin](https://wordpress.org/support/topic/spammy-plugin-2/)󠁿

 [crissman](https://profiles.wordpress.org/crissman/) 1 می 2024

Uninstalled. Spams the WP Admin page with money begs.

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

### 󠀁[A bit buggy](https://wordpress.org/support/topic/a-bit-buggy-4/)󠁿

 [revixi5](https://profiles.wordpress.org/revixi5/) 4 فوریه 2024

The CSS metabox has a spinner that continuously spin, and the CSS is now inject 
inside the BODY content of the page instead of the HEAD… probably another bug. Had
to switch to Simple CSS. It inject the code in the header and minify it.

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

### 󠀁[A very useful plugin](https://wordpress.org/support/topic/a-very-useful-plugin-81/)󠁿

 [Victor Tyavbee](https://profiles.wordpress.org/tsquare07/) 3 می 2023

The plugin is very useful

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

### 󠀁[Such a handy plugin!](https://wordpress.org/support/topic/such-a-handy-plugin-3/)󠁿

 [jjminkle](https://profiles.wordpress.org/jjminkle/) 2 می 2023

I am surprised this plugin is not more popular. It is a great way to add a little
CSS to a page. Sometimes I just find it handy when I want to test CSS before adding
it to my main stylesheet. Especially if I want to show someone global page changes
before actually doing them globally.

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

### 󠀁[Gets the CSS displayed](https://wordpress.org/support/topic/gets-the-css-displayed/)󠁿

 [jmlord](https://profiles.wordpress.org/jmlord/) 6 ژانویه 2023

Hi! Great plugin, exactly what I was looking for. On my version (6.1.1) the CSS 
validation fails due to line 679 (there is no data object in wp object).const ppsccEditPost
= wp.data.select(‘core/edit-post’); Otherwise the CSS saves and displays correctly.

 [ خواندن تمامی 42 نقد و بررسی‌ ](https://wordpress.org/support/plugin/postpage-specific-custom-css/reviews/)

## توسعه دهندگان و همکاران

“Post/Page Specific Custom Code” نرم افزار متن باز است. افراد زیر در این افزونه 
مشارکت کرده‌اند.

مشارکت کنندگان

 *   [ Łukasz Nowicki ](https://profiles.wordpress.org/lukasznowicki/)

“Post/Page Specific Custom Code” به 1 زبان ترجمه شده است. با تشکر از [مترجمین](https://translate.wordpress.org/projects/wp-plugins/postpage-specific-custom-css/contributors)
برای همکاری و کمک‌هایشان.

[ترجمه “Post/Page Specific Custom Code” به زبان شما.](https://translate.wordpress.org/projects/wp-plugins/postpage-specific-custom-css)

### علاقه‌ مند به توسعه هستید؟

[کد را مرور کنید](https://plugins.trac.wordpress.org/browser/postpage-specific-custom-css/)،
[مخزن SVN](https://plugins.svn.wordpress.org/postpage-specific-custom-css/) را بررسی
کنید، یا از طریق [RSS](https://plugins.trac.wordpress.org/log/postpage-specific-custom-css/?limit=100&mode=stop_on_copy&format=rss)
در [گزارش توسعه](https://plugins.trac.wordpress.org/log/postpage-specific-custom-css/)
مشترک شوید.

## گزارش تغییرات

#### 0.3.1

 * Release date: 2026-07-23
 * Fixed “single page view only” checkbox not reflecting the saved value (and overwriting
   it on save)
 * Bundled css-tree 3.1.0 locally instead of loading it from a CDN
 * Editor CSS linting is advisory only (highlights issues); CSS is no longer blocked
   on the front end via a client-side validity flag
 * Removed `_phylax_ppsccss_valid` meta and the hidden live-checker form field
 * Added server-side sanitization for CSS embedded in tags (save and front-end output)
   *
   Hardened CSS sanitizer: escape 0.3.0
 * Release date: 2025-07-21
 * Added support for WooCommerce products (custom CSS can now be assigned to individual
   products)
 * Plugin renamed from “Post/Page specific custom CSS” to “Post/Page Specific Custom
   Code”

#### 0.2.5

 * Release date: 2025-07-17
 * Highlighting for CSS code is now enabled by default.
    7 years ago it was optional
   due to performance concerns on slower machines — nowadays that looks outdated;
   you can still disable it using: add_filter(‘postpage_sccss-highlight_code’, ‘
   __return_false’);
 * Fixed incorrect validation of an empty CSS field
 * Replaced CSS validation with a linting mechanism
 * Minor code improvements and compatibility testing with newer PHP and WordPress
   versions
 * Removed birthday notice

#### 0.2.4

 * Release date: 2022-01-20
 * Fixed default post/page values (they were reversed; thank you, @olandir, for 
   pointing that out!)

#### 0.2.3

 * Release date: 2021-11-29
 * Fixed options saving issue
 * Fixed text formatting

#### 0.2.2

 * Release date: 2020-05-10
 * Many fixes to stay aligned with WordPress coding standards
 * Birthday banner visible only to administrators
 * Birthday banner can now be hidden until the following year
 * Editors can optionally be allowed to edit CSS

#### 0.2.1

 * Release date: 2020-04-27
 * Custom JavaScript note
 * Birthday note

#### 0.2.0

 * Release date: 2020-02-25
 * Compatibility: WordPress 5.3 and earlier
 * Added an options page for the plugin
 * Added default CSS for posts and pages
 * Added CSS highlighting for posts, pages, and the options screen (default CSS)
 * Larger editor fields by default, with an option to make them even bigger

#### 0.1.4

 * Release date: 2018-11-21
 * Status: Stable
 * Compatibility: WordPress 5.0 and earlier
 * Minor code refactoring

#### 0.1.3

 * Release date: 2018-05-18
 * Status: Stable
 * Compatibility: WordPress 4.9.6 and earlier

#### 0.1.2

 * Release date: 2018-05-05
 * Status: Stable
 * Compatibility: WordPress 4.9.5 and earlier
 * Added screenshots, icons, and a header image for the WordPress repository

#### 0.1.1

 * Release date: 2017-08-03
 * Status: Stable
 * Compatibility: WordPress 4.8.1 and earlier
 * Added screenshots, icons, and a header image for the WordPress repository

#### 0.1.0

 * Release date: 2016-12-16
 * Status: Stable
 * Initial release

## اطلاعات

 *  نگارش **0.3.1**
 *  آخرین به‌روزرسانی **1 ماه پیش**
 *  نصب‌های فعال **6,000+**
 *  نگارش وردپرس ** 5.0 یا بالاتر **
 *  آزمایش‌شده تا **7.0.4**
 *  نگارش PHP ** 7.4 یا بالاتر **
 *  زبان‌ها
 * [English (US)](https://wordpress.org/plugins/postpage-specific-custom-css/) و
   [Spanish (Spain)](https://es.wordpress.org/plugins/postpage-specific-custom-css/).
 *  [به زبان خودتان ترجمه کنید](https://translate.wordpress.org/projects/wp-plugins/postpage-specific-custom-css)
 * برچسب
 * [custom css](https://fa.wordpress.org/plugins/tags/custom-css/)[per page CSS](https://fa.wordpress.org/plugins/tags/per-page-css/)
   [woocommerce](https://fa.wordpress.org/plugins/tags/woocommerce/)
 *  [نمایش پیشرفته](https://fa.wordpress.org/plugins/postpage-specific-custom-css/advanced/)

## امتیازها

 4.6 از 5 ستاره.

 *  [  امتیاز 34 5-ستاره     ](https://wordpress.org/support/plugin/postpage-specific-custom-css/reviews/?filter=5)
 *  [  امتیاز 5 4-ستاره     ](https://wordpress.org/support/plugin/postpage-specific-custom-css/reviews/?filter=4)
 *  [  امتیاز 0 3-ستاره     ](https://wordpress.org/support/plugin/postpage-specific-custom-css/reviews/?filter=3)
 *  [  امتیاز 1 2-ستاره     ](https://wordpress.org/support/plugin/postpage-specific-custom-css/reviews/?filter=2)
 *  [  امتیاز 2 1-ستاره     ](https://wordpress.org/support/plugin/postpage-specific-custom-css/reviews/?filter=1)

[بررسی شما](https://wordpress.org/support/plugin/postpage-specific-custom-css/reviews/#new-post)

[مشاهدهٔ همهٔ بررسی‌ها](https://wordpress.org/support/plugin/postpage-specific-custom-css/reviews/)

## مشارکت کنندگان

 *   [ Łukasz Nowicki ](https://profiles.wordpress.org/lukasznowicki/)

## پشتیبانی

چیزی برای گفتن دارید؟ نیاز به کمک دارید؟

 [مشاهده انجمن پشتیبانی](https://wordpress.org/support/plugin/postpage-specific-custom-css/)

## کمک مالی

آیا تمایل دارید از پیشرفت این افزونه حمایت کنید؟

 [ کمک مالی به این افزونه ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LEXEGNRGEF7H4)