WordPress maintenance or security needs? Reach out!
TLDWP

Plugin: wp247-body-classes (Used by 10 domains)

WP247 Body Classes

Add unique classes to the body tag for easy styling based on post attributes (post type, slug, and ID) and various WordPress “is” functions:

  • wp_is_mobile()
  • is_home()
  • is_front_page()
  • is_blog()
  • is_admin()
  • is_admin_bar_showing()
  • is_404()
  • is_super_admin()
  • is_user_logged_in()
  • is_search()
  • is_archive()
  • is_author()
  • is_category()
  • is_tag()
  • is_tax()
  • is_date()
  • is_year()
  • is_month()
  • is_day()
  • is_time()
  • is_single()
  • is_sticky()
  • $post->post_type
  • $post->name
  • $post->ID
  • wp_get_post_categories() (Page/Post Categories)
  • wp_get_post_tags() (Page/Post Tags)
  • $user->nicename
  • $user->id
  • $user->roles
  • $user->allcaps
  • $archive->slug (e.g. Category slug, Tag slug, etc.)
  • $archive->id (e.g. Category id, Tag id, etc.)

Add post specific classes to the body tag in the post editor. Use any class name you want to uniquely style an individual post or a set of posts.

Add classes based on user scrolling through the page. You can check things like:

  • is-scroll-top (at the top of the page – synonym for is-not-scroll)
  • is-not-scroll-top (not at the top of the page – synonym for is-scroll)
  • is-scroll (not at the top of the page – synonym for is-not-scroll-top)
  • is-not-scroll (at the top of the page – synonym for is-scroll-top)
  • is-scroll-top-px (has not reached the scroll start value for scroll measurement by pixels)
  • is-scroll-top-vh (has not reached the scroll start value for scroll measurement by viewport height)
  • is-scroll-top-dh (has not reached the scroll start value for scroll measurement by document height)
  • is-scroll-10-px (scrolled down 10 pixels)
  • is-scroll-8-vh (scrolled down 8% of the viewport height)
  • is-scroll-5-dh (scrolled down 5% of the document height)
  • is-scroll-mid-px (has reached the scroll start value but not the scroll limit for scroll measurement by pixels)
  • is-scroll-mid-vh (has reached the scroll start value but not the scroll limit for scroll measurement by viewport height)
  • is-scroll-mid-vh (has reached the scroll start value but not the scroll limit for scroll measurement by document height)
  • is-scroll-max-px (has reached the scroll limit for scroll measurement by pixels)
  • is-scroll-max-vh (has reached the scroll limit for scroll measurement by percent of viewport height)
  • is-scroll-max-dh (has reached the scroll limit for scroll measurement by percent of document height)

Add classes based on the results from mobiledetect.net’s Mobile_Detect script. This script parses the value passed by the browser in the HTTP_USER_AGENT string. Consequently, mobile detection is more of an art than a science and, unfortunately, is not perfect. You can check things like:

  • is-mobile
  • is-tablet
  • is-phone
  • Mobile Operating System
  • Mobile Browser
  • Type of tablet
  • Type of phone

This plugin adds classes to the html body tag indicating:

  • whether or not the requesting device is a mobile device (.is-mobile or .is-not-mobile)

  • the type of post being viewed (.is-? where ? is the post type (page, post, whetever special post types are defined) ).
    E.g. .is-page or .is-post

  • the slug of the post being viewed (.is-?-! where ? is the post type and ! is the post slug).
    E.g. a post with slug “hello-world’ would have class .is-post-hello-world

  • the ID of the post being viewed (.is-?-# where ? is the post type and # is the post ID).
    E.g. a post with ID “1” would have class .is-page-1

  • whether or not the requested page shows archived results (.is-archive or .is-not-archive)

    If the page being displayed is an archive

    • the type of archive being viewed (.is-? where ? represents the type of archive (author, category, date, tag) )
      E.g. .is-author

    • the slug of the archive being viewed (.is-?-! where ? is the archive type and ! is the archive slug)
      E.g. a category with slug “uncategorized’ would have class .is-category-uncategorized

    • the ID of the archive being viewed (.is-?-# where ? is the archive type and # is the archive ID)
      E.g. a category with ID “1” would have class .is-category-1

  • How far down the page the viewer has scrolled in pixels or as a percentage of viewport height or as a percentage of document height

  • Post specific class(es) that are set in the post editor

Use these classes in your styling to provide a better browsing experience for your viewers.

Custom Body Classes

Create your own Custom Body Classes by adding your PHP code in the “Custom Body Classes” section.

Here’s an example. Not sure why we would want to do it, but suppose we want to do some custom styling when the page is being displayed to someone that can manage WordPress options. We might enter something like:

if (current_user_can('manage_options')) $classes[] = 'user-can-manage-options';

Then we can use the body.user-can-manage-options qualifier in our CSS styling.

Example

Suppose you have a large h1 top margin that you want to eliminate on mobile devices to avoid a lot of white space. After activating the wp247-body-classes plugin and indicating that the .is-mobile class is desired, all you need to do is add this line to your CSS:

body.is-mobile h1 {
margin-top: 0;
}

Suppose you have a sticky header but want to shrink it by dynamically reducing the top and bottom padding from 25px to 5px as the viewer scrolls down the page based on 20 pixel scroll increments up to 80 pixels of scrolling:

Set WP247 Body Classes Scroll setting to “Scroll by Pixel” with a 10 pixel increment and an 80 pixel limit and then add the following to your CSS:

body.is-scroll-20-px header {
padding-top: 20px;
padding-bottom: 20px;
}
body.is-scroll-40-px header {
padding-top: 15px;
padding-bottom: 15px;
}
body.is-scroll-60-px header {
padding-top: 10px;
padding-bottom: 10px;
}
body.is-scroll-max-px header {
padding-top: 5px;
padding-bottom: 5px;
}

DomainExposuresHeadersLast Checked
k*e*w*.de F Aug 4, 2026
s*e*a*e*d*c*o*a*s.org F Jul 29, 2026
p*e*i*i*n*e*i*i*e*g*o*p.com D Jul 27, 2026
p*e*i*i*n*e*i*i*e*r*.com D Jul 27, 2026
a*i*a*a*l*s.com (WP 6.8.3) F Jul 16, 2026
o*m*d*o*.com (WP 6.9.4) F Jul 13, 2026
t*p*a*e.org (WP 5.8) F Jul 3, 2026
k*e*w*v*r*a*.de F Jul 2, 2026
k*m*u*i*t*s*h*j*g*n*.at F Jun 29, 2026
k*o*.at F Jun 20, 2026

Top 50 Plugins

Plugin Count
elementor 1,769,546
contact-form-7 1,749,981
elementor-pro 1,052,223
woocommerce 816,082
revslider 607,977
jetpack 454,169
js_composer 419,320
wp-rocket 341,914
essential-addons-for-elementor-lite 264,421
gravityforms 256,924
complianz-gdpr 256,737
google-site-kit 232,875
cookie-law-info 227,814
instagram-feed 224,435
sitepress-multilingual-cms 210,461
header-footer-elementor 206,426
google-analytics-for-wordpress 205,227
bluehost-wordpress-plugin 192,353
elementskit-lite 179,948
gutenberg 167,312
cookie-notice 148,571
litespeed-cache 144,502
gtranslate 124,687
wpforms-lite 123,530
the-events-calendar 122,126
astra-sites 112,994
popup-maker 109,488
woocommerce-payments 109,111
gutenberg-core 103,132
tablepress 102,372
honeypot 97,721
astra-addon 93,680
wp-smushit 90,667
duracelltomi-google-tag-manager 90,296
layerslider 89,062
all-in-one-seo-pack 88,933
bb-plugin 86,786
coblocks 86,664
akismet 84,909
premium-addons-for-elementor 84,280
cleantalk-spam-protect 82,390
ml-slider 82,251
mailchimp-for-wp 81,565
megamenu 80,147
woocommerce-gateway-stripe 79,293
jet-engine 77,971
fusion-builder 76,925
ewww-image-optimizer 76,777
wp-pagenavi 76,482
smart-slider-3 76,014

Top 50 Themes

Theme Count
hello-elementor 620,559
Divi 495,186
astra 413,486
flatsome 139,309
Avada 120,788
generatepress 114,633
oceanwp 80,215
kadence 78,625
pub 72,283
enfold 68,633
salient 65,039
twentyseventeen 54,205
bb-theme 53,345
betheme 52,372
twentytwentyfour 52,317
blocksy 50,753
cocoon-master 49,244
dt-the7 45,391
twentytwentyfive 44,990
woodmart 43,696
neve 38,026
Avada-Child-Theme 36,901
gox 36,289
h4 36,036
bridge 31,221
twentytwentyone 30,243
lightning 30,028
twentytwenty 28,729
swell 28,063
bricks 26,498
Impreza 26,031
Newspaper 24,165
twentytwentythree 22,103
epik-redesign 19,110
twentytwentytwo 18,748
uncode 18,454
pro 17,625
twentysixteen 17,590
sydney 16,367
storefront 16,296
Total 14,353
hello-theme-child-master 14,025
factory-templates-4 13,734
themify-ultra 12,929
extendable 12,681
hestia 12,551
yootheme 12,472
yith-wonder 12,080
porto 11,949
twentyfifteen 11,850