WordPress主题开发:CSS文件该怎么写?主样式表(style.css)

2022年07月15日 • 阅读 1053
为了使WordPress将主题模板文件的集合识别为有效的主题,style.css文件需要位于主题的根目录中,而不是子目录。有关如何将style.css文件包含在主题中的更详细说明,请参阅“启动脚本和样

为了使WordPress将主题模板文件的集合识别为有效的主题,style.css文件需要位于主题的根目录中,而不是子目录。

有关如何将style.css文件包含在主题中的更详细说明,请参阅“启动脚本和样式”的“样式表”部分。


WordPress使用style.css的标题注释部分在“外观(主题)”仪表板面板中显示有关主题的信息。


示例

/*
Theme Name: Twenty Seventeen

Theme URI: https://wordpress.org/themes/twentyseventeen/

Author: the WordPress team

Author URI: https://wordpress.org/

Description: Twenty Seventeen brings your site to life with immersive featured images and subtle animations. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.

Version: 1.0

License: GNU General Public License v2 or later

License URI: http://www.gnu.org/licenses/gpl-2.0.html

Text Domain: twentyseventeen

Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

使用(*)表示的项目是WordPress主题库中的主题所必需的。


注意:WordPress主题存储库使用此文件中“版本”之后的数字来确定主题是否具有可用的新版本。


  • Theme Name (*): 主题名称。

  • Theme URI: 公共网页的URL,用户可以在其中找到有关该主题的更多信息。

  • Author (*): 开发主题的个人或组织的名称。 建议使用主题作者的wordpress.org用户名。

  • Author URI: 创作个人或组织的网址。

  • Description (*): 简短描述的主题。

  • Version (*): 该版本以X.X或X.X.X格式编写。

  • License (*): 主题的协议。

  • License URI (*): 主题许可证的URL。

  • Text Domain (*): 用于文本域的字符串用于翻译。

  • Tags: 允许用户使用标签过滤器查找主题的单词或短语。 标签的完整列表在“主题评论手册”中。


本文由青舟模板网发布,如若转载,请注明出处:http://qingzo.com/jishu/1657867457.html
评论列表

共有0条评论来说两句吧...

欢迎 发表评论: