[wordpress插件] Add URL Slugs as Body Classes将网址段添加为正文类

wordpress 插件 文章 2020-01-31 19:20 565 0 全屏看文

AI助手支持GPT4.0

评分

96

96

描述

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

此插件获取URL,将其切成碎片,并将每个“碎片”添加为附加的

class to the body tag.

类到 body 标记。

Meaning, if your page’s URL is:

意思是,如果页面的URL是:

http://www.example.com/2012/02/24/wordpress-plugin-add-url-slugs-as-body-classes/

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:
    

您页面的 body 标记至少应具有以下类别:
    

2012 02 24 wordpress-plugin-add-url-slugs-as-body-classess

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/

http://www.example.com/category/wordpress/

which would add:
    

其中会添加:
    

category wordpress

类别wordpress

while:
    

时间:
    

http://www.example.com/movies/star-trek/wrath-of-khan/

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.

这使您可以基于这些新的CSS类非常轻松地向这些页面添加自定义CSS和/或JS。

Please let me know if you have any questions/suggestions/thoughts,

如果您有任何疑问/建议/想法,请告诉我,

Atg

Atg

http://aarontgrogg.com/

http://aarontgrogg.com/

aarontgrogg@gmail.com

aarontgrogg@gmail.com

安装步骤

    1. Download the ZIP
    2. 下载ZIP

    3. Unzip the ZIP
    4. 解压缩ZIP

    5. Copy/paste the unzipped files into your WP plug-in directory (/wp-content/plugins/)
    6. 将解压缩的文件复制/粘贴到WP插件目录( / wp-content / plugins /

    7. From within WP’s Plugin Admin panel, Activate the plug-in
    8. 在WP的“插件管理”面板中,激活插件

    9. Write some wicked CSS to amaze your friends and befuddle your enemies…
    10. 编写一些邪恶的CSS来使您的朋友惊奇并迷惑您的敌人...

下载地址

https://downloads.wordpress.org/plugin/add-url-slugs-as-body-classes.1.3.zip

https://downloads.wordpress.org/plugin/add-url-slugs-as-body-classes.1.3.zip

-EOF-

AI助手支持GPT4.0