🔥 Black Friday Sale: Get 65% OFF Any PageForge Pro Plan! Use code BF65 Claim Offer →
Compte Get it free
WP247 Body Classes icon
Peut-être abandonné Tested up to 6.5.15 #44 in mobile

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:

Installations actives200+100+ niveaux
Téléchargements · 30D278▲ +141.7% vs prev. 30d
Évaluation4.5/56 avis
Score de santé36/100En danger
Téléchargements de tous les temps8.4KDepuis mars 2015
Support résolu—Aucun fil de discussion récent
A besoin deWP 4.0Php tout
Téléchargements · 7j43▼ -2.3% week over week
Notre verdict

Envisager une alternative

WP247 Body Classes shows warning signs in 2026 — compare the alternatives below before installing. It runs on 200+ sites, is rated 4.5/5 and was last updated 3 years ago, and scores 36/100 on our health check.

  • Petite base d'utilisateurs (plus de 200 installations actives)
  • Pas de mise à jour dans 2 ans
  • Uniquement testé jusqu'à WordPress 6,5 (le dernier est de 7,1)

Comment s'accumule-t-il ?

Côte à côte sur les installations, les mises à jour, les évaluations et le support

Téléchargements quotidiens

244974Sep 3Oct 17Dec 1
Hier5
Moyenne quotidienne (1 ans)3
Jour de pointe9913 Novembre 2026
12 Derniers mois980

Les pics de téléchargement suivent généralement une nouvelle version - chaque site qui met à jour automatiquement compte comme un téléchargement.

Classements

Where WP247 Body Classes stands today

WordPress.org Classements de recherche

Position en direct dans la recherche de plugins, Top 100
Mot-cléPositionPlugins concurrentsCatégorie
mobile >100 10,000 Best mobile plugins →
post type >100 10,000 Best post type plugins →
scroll >100 5,334 Best scroll plugins →
user capabilities >100 7,448 Best user capabilities plugins →
user roles >100 6,964 Best user roles plugins →

Adoption de version

Part de sites actifs par version.

  • 2.271.6%
  • 2.114.4%
  • 2.08.7%
  • 1.15.3%

Répartition des notes

★★★★★ ★★★★★ 4,5 sur 6 avis

  • 5★83.3%
  • 4★0.00%
  • 3★0.00%
  • 2★16.7%
  • 1★0.00%

About WP247 Body Classes

À partir du Lisezmoi officiel · v2.2.0

Description

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.

Exemple

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;
}

Installation

In the WordPress backend:

  • Go to Plugins->Add New
  • Search for the plugin ‘wp247 Body Classes’
  • Click the “Install” button
  • Click on “Activate”

That’s it. You’re now ready to customize your viewer’s browsing experience.

Journal de modifications

2.2.0

Added Mobile_Detect 3.74.0
Added Multipage Body Classes
Added is_singular()
Fixed is_single(), is_sticky()
Updated wp247 URL

2.1.1

Fix post type for Custom Individual Post Body Classes

2.1

Removed Notifications Plugin corequisite
Fixed Settings API for PHP v7
Updated Admin Favorites
Added Custom Individual Post Body Classes
Added Mobile-Detect version 2.8.34
Added Mobile-Detect version 2.8.37
Added User Roles Classes
Added User Capabilities Classes

2.0.1

Fixed Settings API bug

2.0

Added Scroll Classes
Added page categories, post categories, and post tags options
Added ability to choose Mobile-Detect Version
Added Mobile-Detect version 2.8.26
Improved performance
Improved memory footprint
Added security to disallow script direct execution

1.1.3

Removed namespace use in WP247 Settings API to due errors

Journal des modifications complet sur WordPress.org →

Captures d'écran

Mobile Classes setting selection
Mobile Classes setting selection
Environment Classes setting selection
Environment Classes setting selection
User Classes setting selection
User Classes setting selection
Archive Classes setting selection
Archive Classes setting selection
Post Classes setting selection
Post Classes setting selection
Scroll Classes setting selection
Scroll Classes setting selection
Custom Classes setting
Custom Classes setting
Custom CSS setting
Custom CSS setting
Custom Individual Post Body Classes
Custom Individual Post Body Classes

Pour les développeurs

Est-ce votre plugin ? Montrez les chiffres.

Ajoutez un badge en direct à votre site, docs ou github readme. Il se met à jour par lui-même - aucun compte n'est nécessaire.

Badge d'installations actives Badge Badge de score de santé

Best WP247 Body Classes alternatives

All mobile plugins →
Alternatives
Rang Plugin Installations actives Évaluation Mise à jour Santé
1 AMP AMP An easier path to great Page Experience for everyone. Powered by AMP. by Weston Ruter 300K+ ★★★★★★★★★★ 3.8 (367) Il y a 2 ans 57
2 AMP pour WP – pages mobiles accélérées AMP pour WP – pages mobiles accélérées AMP pour WP est le plugin AMP le plus recommandé par la communauté. Ajouter automatiquement… par Mohammed Kaludi 70K+ ★★★★★★★★★★ 4.4 (1.3K) il y a 6 heures 77
3 WP Mobile Menu – Le menu réactif adapté aux mobiles WP Mobile Menu – Le menu réactif adapté aux mobiles Besoin d'aide pour l'expérience du site Web mobile ? Besoin d'un plugin de menu mobile qui garde... par Rui Guerreiro 70K+ ★★★★★★★★★★ 4.7 (256) il y a 4 semaines 79
4 WPtouch – Make your WordPress Website Mobile-Friendly WPtouch – Make your WordPress Website Mobile-Friendly With just a few clicks, make your WordPress website mobile-friendly (iPhone, Android, and… by WPtouch 40K+ ★★★★★★★★★★ 3.7 (341) il y a 1 semaine 74
5 Menu réactif WP Menu réactif WP WP Responsive Menu transforme votre menu WordPress en un coulissant hautement personnalisable… Par Nirmal Kumar Ram 30K+ ★★★★★★★★★★ 4.3 (100) Il y a 3 mois 82
6 Favicon Rotator Favicon Rotator Easily set site favicon and even rotate through multiple icons par archétype 20K+ ★★★★★★★★★★ 4.3 (12) Il y a 3 mois 78
7 Lecteur vidéo facile Lecteur vidéo facile Easy Video Player est un lecteur vidéo WordPress qui vous permet d'ajouter des vidéos à votre… de Noor Alam 20K+ ★★★★★★★★★★ 4.2 (57) Il y a 2 mois 86
8 ShiftNav – Menu mobile réactif ShiftNav – Menu mobile réactif Ajoutez un menu de navigation mobile réactif de style natif à votre site. par Sevenspark 10K+ ★★★★★★★★★★ 4.6 (68) Il y a 1 an 54
9 Definitely allow mobile zooming Definitely allow mobile zooming This tiny plugin adds silently the viewport meta tag with zooming permission to allow your… par Kybernetik Services 7K+ ★★★★★★★★★★ 5 (54) Il y a 3 mois 85
10 WP Responsive Table WP Responsive Table Makes HTML tables horizontally scrollable on a small screen and customizes tables styles. by Processby 6K+ ★★★★★★★★★★ 4.8 (13) Il y a 6 ans 40

FAQ

WP247 Body Classes: quick answers

Réponses directes, extraites des données en direct WordPress.org.

Source : WordPress.org

Is WP247 Body Classes free?

Yes. WP247 Body Classes is free to download and use from the official WordPress.org plugin directory.

Is WP247 Body Classes safe to use in 2026?

WP247 Body Classes shows warning signs in 2026 — compare the alternatives below before installing. It runs on 200+ sites, is rated 4.5/5 and was last updated 3 years ago, and scores 36/100 on our health check.

How many websites use WP247 Body Classes?

WP247 Body Classes is active on 200+ WordPress websites and has been downloaded 8,370 times since it launched in March 2015. It was downloaded 278 times in the last 30 days.

Does WP247 Body Classes work with WordPress 7.1?

WP247 Body Classes is officially tested up to WordPress 6.5.15, while the latest release is 7.1.5. It may still work, but try it on a staging site first.

When was WP247 Body Classes last updated?

The latest version, 2.2.0, was released on May 24, 2024 (3 years ago).

Who makes WP247 Body Classes?

WP247 Body Classes is developed and maintained by wescleveland.

What are the best alternatives to WP247 Body Classes?

The most popular alternatives to WP247 Body Classes are AMP (300K+ installs), AMP for WP (70K+ installs) and WP Mobile Menu (70K+ installs).

Propulsé par PageForge

Un modèle et une feuille de calcul. Une vraie page pour chaque recherche.

PageForge transforme chaque ligne d'un CSV en une page WordPress avec son propre titre, URL, SEO et schéma, construit sur la mise en page que vous Déjà conçu. Gratuit sur WordPress.org.

  • CSV et XLSX, plus Google Sheets sur les professionnels et les entreprises
  • Son propre titre, URL, SEO champs et schéma pour chaque page
  • Fonctionne avec l'éditeur de blocs, Elementor, Divi et Avada
  • Gratuit sur WordPress.org, pas de carte de crédit

↑↓ bouger↵ ouvrir