Title: Custom Class Add On Page
Author: syedkamruzzaman
Published: <strong>9 اکتبر 2025</strong>
Last modified: 9 اکتبر 2025

---

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

![](https://ps.w.org/custom-class-add-on-page/assets/banner-772x250.png?rev=3375979)

این افزونه **با ۳ نگارش عمدهٔ اخیر وردپرس آزمایش نشده است**. ممکن است دیگر نگهداری
یا پشتیبانی نشود و هنگام استفاده با نگارش‌های تازه‌تر وردپرس مشکل سازگاری داشته 
باشد.

![](https://ps.w.org/custom-class-add-on-page/assets/icon-256x256.png?rev=3375979)

# Custom Class Add On Page

 توسط [syedkamruzzaman](https://profiles.wordpress.org/syedkamruzzaman/)

[دانلود](https://downloads.wordpress.org/plugin/custom-class-add-on-page.1.0.0.zip)

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

 [پشتیبانی](https://wordpress.org/support/plugin/custom-class-add-on-page/)

## توضیحات

Add your own CSS classes to specific Pages, Posts, or Custom Post Types—without 
editing theme files.
 Add custom `<body>` classes—safely prefixed—on any Page, Post,
CPT, or WooCommerce view (Shop, Cart, Checkout, My Account) with zero theme edits.

I created **Custom Class Add On Page** as a simple way to manage `<body>` classes
with a safe `ccaop_` prefix. Choose the target (Page, Blog page, Single Post, CPT
archive/single, or a specific CPT item), save, and the class is injected via the`
body_class` filter. Clean code, lightweight implementation, and solving real problems
are the focus. Collaboration and feedback are welcome.

**Highlights**
 – Add classes to: a single Page, the Blog (Posts) page, all Single
Posts, CPT Archive, all CPT Singles, or a specific CPT item. – Safe auto-prefix (`
ccaop_`) prevents conflicts. – WooCommerce-aware: Shop (product archive), Cart, 
Checkout, and My Account are supported. – Clean admin UI with a table listing every
rule you’ve created (class + location) and a delete action. – Activation redirect:
after activation, you’re taken straight to the settings page. – Lightweight: uses
the `body_class` filter only—no front-end bloat.

 * [Need Help?](https://syed-kamruzzaman.com/#contact)
 * [About Author](https://syed-kamruzzaman.com/)

### Video Tutorial

### ⚡ What you can configure

 * Enter a custom class name (auto-saved as `ccaop_{your_class}`).
 * Choose where to apply it: **Page / Post / Custom Post**.
 * For **Page**  pick any page (Blog/Posts page is intentionally excluded here; 
   use Post  Blog page).
 * For **Post**  choose **Blog page (posts index)** or **All single posts**.
 * For **Custom Post**  choose the CPT and target (**Archive**, **All single**, 
   or **Specific item**).

#### Usage

 1. Go to **Dashboard  Class Option**.
 2. Type your class name (e.g. `hero`, saves as `ccaop_hero`).
 3. Select **Page / Post / Custom Post**, then pick the exact target.
 4. Click **Save**. Visit the selected view and inspect `<body>`—you’ll see your class.

### ⚡ Features

 * Ready to use—no coding needed
 * Auto-prefixed classes to avoid collisions
 * Page / Post / CPT (archive, single, specific item) targets
 * WooCommerce Shop, Cart, Checkout, My Account support
 * Rule list with delete action
 * Lightweight & fast, theme-agnostic
 * Works with cached sites (no dynamic output buffering)

### WooCommerce Notes

If you select the **Shop** page under _Page_, the plugin detects it as the **product
archive** and adds your class on Shop views correctly.
 Similarly, **Cart**, **Checkout**(
including endpoints like order-pay, order-received) and **My Account** are handled.

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

[⌊Settings screen—add a class and choose where it applies⌉⌊Settings screen—add a
class and choose where it applies⌉[

Settings screen—add a class and choose where it applies

[⌊Page/Post/CPT selectors (conditional dropdowns)⌉⌊Page/Post/CPT selectors (conditional
dropdowns)⌉[

Page/Post/CPT selectors (conditional dropdowns)

[⌊Rules table with locations and delete action⌉⌊Rules table with locations and delete
action⌉[

Rules table with locations and delete action

[⌊Example: class added to <body> on the front end⌉⌊Example: class added to <body
> on the front end⌉[

Example: class added to `<body>` on the front end

[⌊WooCommerce Shop page with custom body class⌉⌊WooCommerce Shop page with custom
body class⌉[

WooCommerce Shop page with custom body class

## نصب

#### Minimum Requirements

 * WordPress 5.8 or greater
 * PHP 7.2 or greater
 * MySQL 5.0 or greater

#### Automatic Installation

 1. In your WordPress dashboard, go to **Plugins  Add New**.
 2. Search for **Custom Class Add On Page**.
 3. Click **Install Now** and then **Activate**.
     You’ll be redirected to the settings
    page.

#### Manual Installation

 1. Upload the plugin folder to `/wp-content/plugins/`.
 2. Activate the plugin from **Plugins** in your dashboard.
 3. Go to **Class Option** in the admin menu.

#### Updating

Automatic updates should work seamlessly. As always, back up your site before updating.

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

### Will this change my site’s HTML structure?

No. It only appends your custom class to the `<body>` element via WordPress’s `body_class`
filter.

### Can I add multiple rules?

Yes. Add as many mappings (class  location) as you need. Each shows up in the table
where you can delete them later.

### Why can’t I see the Blog (Posts) page under “Page”?

By design, the Blog page is managed under **Post  Blog page** to avoid confusion
with static pages.

### Does it support WooCommerce pages?

Yes—Shop (product archive), Cart, Checkout (and its endpoints), and My Account are
supported.

### Will my class be exactly what I type?

Your input is sanitized and auto-prefixed with `ccaop_` (e.g. `container`  `ccaop_container`)
to keep it safe and unique.

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

نقد و بررسی‌ای برای این افزونه یافت نشد.

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

“Custom Class Add On Page” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت
کرده‌اند.

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

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

[ترجمه “Custom Class Add On Page” به زبان شما.](https://translate.wordpress.org/projects/wp-plugins/custom-class-add-on-page)

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

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

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

#### 1.0.0

 * Initial release: add custom classes to Pages, Posts, and CPTs; WooCommerce-aware;
   rule list; activation redirect.

## اطلاعات

 *  نگارش **1.0.0**
 *  آخرین به‌روزرسانی **1 سال پیش**
 *  نصب‌های فعال **کمتر از 10**
 *  نگارش وردپرس ** 6.7 یا بالاتر **
 *  آزمایش‌شده تا **6.8.11**
 *  نگارش PHP ** 7.2 یا بالاتر **
 *  زبان
 * [English (US)](https://wordpress.org/plugins/custom-class-add-on-page/)
 * برچسب
 * [body class](https://fa.wordpress.org/plugins/tags/body-class/)[custom class](https://fa.wordpress.org/plugins/tags/custom-class/)
   [custom post type](https://fa.wordpress.org/plugins/tags/custom-post-type/)[page class](https://fa.wordpress.org/plugins/tags/page-class/)
   [woocommerce](https://fa.wordpress.org/plugins/tags/woocommerce/)
 *  [نمایش پیشرفته](https://fa.wordpress.org/plugins/custom-class-add-on-page/advanced/)

## امتیازها

هنوز هیچ نقدی ارسال نشده است.

[بررسی شما](https://wordpress.org/support/plugin/custom-class-add-on-page/reviews/#new-post)

[مشاهدهٔ همهٔ بررسی‌ها](https://wordpress.org/support/plugin/custom-class-add-on-page/reviews/)

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

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

## پشتیبانی

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

 [مشاهده انجمن پشتیبانی](https://wordpress.org/support/plugin/custom-class-add-on-page/)