Add URL Slugs to `body` Class
bodytag 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
Say you created a Post that could be found at the following URL:
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:
get these additional CSS classes:
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:
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.
Requires: 3.1 or higher
Compatible up to: 4.2.5
Last Updated: 2015-5-15
Active Installs: 600+
Got something to say? Need help?