Add URL Slugs as Body Classes

Add URL Slugs as Body Classes Install Statistics

0
100%
Today: 0 Yesterday: 0 All-time: 5,371 downloads
Add URL Slugs as Body Classes Icon

Try plugin: Add URL Slugs as Body Classes

We'll create fresh WordPress site with Add URL Slugs as Body Classes installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About Add URL Slugs as Body Classes

Add URL Slugs to body Class

4


1


0


0


0

updated: 9 years ago
since: 12 years ago
author: Aaron T. Grogg

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]