Plugin info

Total downloads: 6,318
Active installs: 800
Total reviews: 5
Average rating: 4.8
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 5/15/2015 (3883 days ago)
Added to WordPress: 2/25/2012 (13 years old)
Minimum WordPress version: 3.1
Tested up to WordPress version: 4.2.39
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 3883 days ago • 5 reviews

22/100

Is Add URL Slugs as Body Classes abandoned?

Possibly abandoned (last update 3883 days ago).

Compatibility

Requires WordPress: 3.1
Tested up to: 4.2.39
Requires PHP: f

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Custom Body Class
Rating 5.0/5 (21 reviews)Active installs 10,000
Add Custom Body Class
Rating 5.0/5 (8 reviews)Active installs 1,000
Slug as body class
Rating 5.0/5 (6 reviews)Active installs 100
LH Add Roles to Body Class
Rating 5.0/5 (1 reviews)Active installs 30
Add Custom Post Type Slugs to Admin Body Class
Rating 5.0/5 (1 reviews)Active installs 10
OS Adder
Rating 0.0/5 (0 reviews)Active installs 10

Description

This plug-in takes the URL, chops it into pieces, and adds each “piece” as an additional
class to the body tag.

Meaning, if your page’s URL is:
http://www.example.com/2012/02/24/wordpress-plugin-add-url-slugs-as-body-classes/
Your page’s body tag would have at least these classes:
2012 02 24 wordpress-plugin-add-url-slugs-as-body-classess

It gets much stronger when you start thinking about Categories or nested Pages:
http://www.example.com/category/wordpress/
which would add:
category wordpress
while:
http://www.example.com/movies/star-trek/wrath-of-khan/
would add:
movies star-trek wrath-of-khan

This allows you to very easily add custom CSS and/or JS to these pages based on these new CSS classes.

Please let me know if you have any questions/suggestions/thoughts,
Atg
http://aarontgrogg.com/
[email protected]

Installation

  1. Download the ZIP
  2. Unzip the ZIP
  3. Copy/paste the unzipped files into your WP plug-in directory (/wp-content/plugins/)
  4. From within WP’s Plugin Admin panel, Activate the plug-in
  5. Write some wicked CSS to amaze your friends and befuddle your enemies…

Frequently Asked Questions

What does this do, exactly?

  • Additional CSS classes are added to the HTML body tag so you can easily add custom CSS and/or JS to Posts or
    Pages. Basically anything that appears in the URL after your domain name, will be split on the “/”, then
    pushed back together separated by spaces in the HTML’s body tag.

What classes?

  • Say you created a Post that could be found at the following URL:
    http://www.example.com/2012/02/24/wordpress-plugin-add-url-slugs-as-body-classes/
    That page’s body tag would have at least these classes:
    2012 02 24 wordpress-plugin-add-url-slugs-as-body-classess

    It gets much stronger when you start thinking about Categories or nested Pages, because a Category page like:
    http://www.example.com/category/wordpress/
    get these additional CSS classes:
    category wordpress
    This would allow you to add custom CSS and/or JS to all Category pages, or even just the WordPress Category page!

    Or a nested Page that could be found at this URL:
    http://www.example.com/movies/star-trek/wrath-of-khan/
    would get these additional CSS classes:
    movies star-trek wrath-of-khan
    So you could add custom CSS just for your Movies pages, other custom CSS for just the Star Trek Movies pages,
    and still more custom CSS for just the Wrath of Khan Star Trek Movie page.

Why would I want to do this?

  • Really only if you used some custom CSS or JS to some specific webpages. You could add custom background images,
    use different fonts, add sound effects, add different JS libraries, the list is limited only by your needs, really.

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

1.3

2015-05-15:
* Tested & verified in WP 4.2.2, and added a few FAQs

1.1

2013-01-11:
* Tested & verified in WP 3.5

1.0

2012-02-24:
Well, this is the first version, so… here it is!