Skip to main content
Agency Program Get 2× more leads and save 50% on hosting. Built for agencies ready to grow. Book a call
Custom Body Class icon

Custom Body Class

v0.7.4
by Andrei Lupu · 5.0 (20 reviews)

A plain simple plugin which allows you to add a custom CSS class the HTML body tag.

10K+ active installs Updated Jan 20, 2025 Tested to 6.7.2
Try Demo Download
Pre-installed Ready in ~10s No card

About Custom Body Class

This plugin allows you to add a unique CSS class to your pages or posts. You can also add a class that will only appear on mobile devices by adding "mobile-" to the front of the class. If you find this plugin helpful, you can support the developer by using the Github Sponsor button, buying them a coffee on Ko-fi, watching them code on Twitch, or visiting their website.

Frequently asked questions

How can I add a unique CSS class to my pages or posts?
You can use this plugin to add a unique CSS class to your pages or posts.
Is there a demo available for this plugin?
Yes, you can try out a quick WordPress instance with this plugin in this demo: [link]
How can I add a class that appears only on mobile devices?
To add a class that appears only on mobile devices, simply add 'mobile-' on the front of the class. For example, if you want to have the class 'car' for mobile side, you would use 'mobile-car'.
How can I support the creator of this plugin?
If you find this plugin helpful, you can support the creator by using the Github Sponsor button, becoming a Patreon, donating through Ko-fi, watching their coding streams on Twitch, or simply visiting their site.

Changelog

0.7.4

  • Update: Check compatibility with WordPress 6.7.1 and PHP 8.2.

0.7.3

  • Update: Check compatibility with 6.0.0.

0.7.2

  • Fix: Properly instantiate plugin default settings.

0.7.1

  • Update: Check for nonce existence on settings page form.

0.7.0

  • Update: Better escapes for the plugin’s settings page.
  • Update: Modified textdomain as the plugin’s name.
  • Add: Nonce verification for the plugin’s settings page.

0.6.0

  • Fix: Now the metabox will load even if the Autocomplete feature is off.
  • Add: The capability to restrict the metabox for Administrators only.

0.5.0

  • Add an option for a global class

0.4.0

  • Add support for classes on mobile devices

0.3.0

  • Add a tag selector with autocomplete for all post types

0.0.3

  • Quick archives fix

0.0.2

  • Small fixes, and typos

0.0.1

  • We are on

Try other plugins

WooCommerce Shipping & Tax icon

WooCommerce Shipping & Tax

2.0 · 700K+ installs

WooCommerce Shipping & Tax offers automated tax calculation, shipping label printing, smoother payment setup, and other hosted services…