Linux 软件免费装
Banner图

Custom Class Add On Page

开发者 syedkamruzzaman
更新时间 2025年10月10日 05:04
PHP版本: 6.7 及以上
WordPress版本: 6.8
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce custom post type custom class body class page class

下载

1.0.0

详情介绍:

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

安装:

Minimum Requirements 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.

屏幕截图:

  • Page/Post/CPT selectors (conditional dropdowns)
  • Rules table with locations and delete action
  • Example: class added to `<body>` on the front end
  • WooCommerce Shop page with custom body class

升级注意事项:

N/A

常见问题:

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. containerccaop_container) to keep it safe and unique.

更新日志:

1.0.0