plugin-icon

Add URL Slugs as Body Classes

投稿者: Aaron T. Grogg·
Add URL Slugs to body Class
評価
4.8/5
バージョン
1.3
有効インストール数
800
最終更新日時
May 15, 2015

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/ aarontgrogg@gmail.com

無料Business プランを利用中
インストールすることで、WordPress.com の利用規約サードパーティプラグイン利用規約に同意したことになります。
最大テスト回数
WordPress 4.2.39
このプラグインをダウンロードして、 サイトに使用できます。