wordpress主题包中主题详情是通过style.css来设置的

wordpress主题包中主题详情是通过style.css来设置的

 2016-09-10 15:17

今天继续摸索做我的wordpress主题,发现别人的WP主题包中都有一些详细的说明,比如版本号,作者情况,主题情况等说明,而我的却没有。开始我以为是某个单独的PHP文件里写的这些信息的,或者是一个functions朗阔的,但找了半天都没有找到。

最后没法,我只能通过删除法来排查了。删了所有的文件,最后只剩下index.php和style.css文件时,我终于找到的。

在style.css抬头有一处备注,我以为是作者对主题进行的一些情况备注,就删除了。后来发现,这些备注关系到主题包中主题详情的情况说明:

/*
Theme Name: Twenty Sixteen(主题名称)
Theme URI: https://wordpress.org/themes/twentysixteen/(主题链接地址)
Author: the WordPress team(作者名称)
Author URI: https://wordpress.org/(作者链接地址)
Description: Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere.(主题详细说明,支持中文,也似乎可以直接翻译)
Version: 1.3(版本号)
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog
Text Domain: twentysixteen

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主题包中主题详情是通过style.css来设置的)