Enhanced Body Class

Enhanced Body Class

Wordpress plugin

Install on Wordpress

App Details

WordPress plugin to add user-related classes to the body tag. This can be enabled on the frontend and backend of the site.
The css classes allow you to easily customize styling by role or a specific user.

Features

  • Toggle display on frontend and admin pages
  • Toggle classes for role, user name and user id
  • Template hinting to load custom theme css files for frontend and admin

Stylesheets

  • Add to theme folder (optional): enhanced-body-class-frontend.css
  • Add to theme folder (optional): enhanced-body-class-admin.css

Scripts

  • Add to theme folder (optional): enhanced-body-class-frontend.js
  • Add to theme folder (optional): enhanced-body-class-admin.js

Styles

  • .user-role-{rolename} ex: .user-role-author
  • .user-name-{username} ex: .user-name-bobdobbs
  • .user-id-{ID} ex: .user-id-1

Usage

After activating the class on the body tag, it will be up to you to use css or javascript to customize the display.

  1. Activate ‘User Role’ on ‘Admin Pages’ in plugin settings
  2. Observe classes on BODY tag by viewing the webpage source. You may need to refresh the page to see the updated class.
  3. Navigate to current theme and create file enhanced-body-class-admin.css
  4. Edit enhanced-body-class-admin.css and add the following:

    body.user-role-administrator { background-color: cyan; }

Refresh the page. You should now see a cyan background. You can now update the css to change the display of specific
page elements.

Real Usage

This plugin was developed to hide certain elements in a popular photo gallery from users with a specific role.

Create the theme file enhanced-body-class-admin.css

` 

body.user-role-contributor #updategallery #gallerydiv { display: none; }
`

Create the theme file enhanced-body-class-admin.js

` 

jQuery(document).ready(function($) {
$(‘body.user-role-contributor select#bulkaction option[value=”copy_to”]’).attr(‘disabled’, ‘disabled’);
});
`

About This Plugin

This plugin was created by Noah J. Stewart in response to a specific problem. In January 2019,
Noah Stewart was contacted by his father Jim Stewart regarding a WordPress photo gallery plugin
that his astronomy club was using. They were having trouble customizing a few of the role-based
options in a popular gallery plugin. Like any good graphic artist, Jim was trying to improve
the interface for the site users. The simplest approach to the problem was to use css to
selectively hide certain elements, ie. invisible content users with the author role that
should be visible to users with the administrator role.

Pricing

Starting from $0 per month.

Check Out the Pinterest Feed Widget

By Common Ninja

Pinterest FeedTry For Free!

App Info

Rating

Reviewers

No reviews

Tags

No tags

Developed By

Noah J. Stewart

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Maps

Maps plugins for Wordpress

Translation

Translation plugins for Wordpress

Chat

Chat plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Contact

Contact plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Forms

Forms plugins for Wordpress

Comments

Comments plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Comments

Comments plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Video Player

Video Player plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Security

Security plugins for Wordpress

Ads

Ads plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Membership

Membership plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Pinterest Feed for Wordpress logo

Pinterest Feed

Show Pinterest content in a Pinterest feed that keeps your page visually engaging, highlights new ideas, and helps visitors explore fresh inspiration.

Video Gallery for Wordpress logo

Video Gallery

Showcase videos with a video gallery that organizes clips from multiple sources in clear visual layouts that keep visitors watching and support higher conversions.

Corner Coupon Pop-up for Wordpress logo

Corner Coupon Pop-up

Add a corner coupon pop-up to highlight discounts, collect emails, and drive user engagement without interrupting browsing.

Highlighted Headlines for Wordpress logo

Highlighted Headlines

Enhance titles with highlighted headlines that use custom colors, animations, and styles to draw attention and help visitors notice key messages.

Video Poll for Wordpress logo

Video Poll

Create interactive video polls that use engaging clips to boost participation, gather insights, and help visitors vote in a more dynamic way.

Video Slider for Wordpress logo

Video Slider

Showcase clips with a video slider that plays videos from multiple sources in a smooth slideshow, improving design and keeping visitors engaged.

YouTube Slider for Wordpress logo

YouTube Slider

Show YouTube videos with a YouTube slider that displays clips in a smooth, customizable layout to boost engagement.

Countdown to Download for Wordpress logo

Countdown to Download

Use a countdown to download widget that reveals files after the timer ends, builds anticipation, and guides visitors toward higher engagement.

Medium Feed for Wordpress logo

Medium Feed

Show Medium articles in a Medium feed that keeps content fresh, improves readability, and helps visitors discover more posts.

Stop Motion Player for Wordpress logo

Stop Motion Player

Create engaging stop motion displays with a stop motion player that turns image sequences into interactive animations to boost creativity and visitor engagement.

Bluesky Feed Slider for Wordpress logo

Bluesky Feed Slider

Show Bluesky posts with a Bluesky feed slider that scrolls updates and keeps content visible while keeping visitors engaged.

Image Magnifier for Wordpress logo

Image Magnifier

Use an image magnifier to let visitors zoom in on photos, view fine details clearly, and enjoy a more accessible and informative visual experience.

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms