Sha*_*haz 3 php wordpress wordpress-theming
我不明白为什么会这样,因为我有一个index.php页面.还有css样式表.style.css还有以下评论
style.css文件
Theme Name: samirTheme
Author: samir
Author URI: www.wordpress.com
Version: 1.0
Description: This is a cool theme
Template: Test1
Run Code Online (Sandbox Code Playgroud)
这是文件夹结构
wordpress新手.很困惑为什么主题被打破而且没有出现在wordpress中.有任何想法吗?
Sha*_*haz 12
解决方案解决 方案实际上非常简单.我发现很难找到一个好的资源来回答,所以我在这里回答.
缺少style.css:模板:评论标题中的主题即
/*
Theme Name: samirTheme
Theme URI: http://example.com/twenty-fifteen-child/
Description: Twenty Fifteen Child Theme
Author: John Doe
Author URI: http://example.com
Template: twentyfifteen <--------------------------------------------
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-fifteen-child
*/
Run Code Online (Sandbox Code Playgroud)
为了使WordPress将主题模板文件集识别为有效主题,style.css文件需要位于主题的根目录中,而不是子目录中。
因此,根目录中的主要主题css文件->然后将包含所有样式的第二个样式表放入队列-如果您希望它位于/ css /
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.
*/
Run Code Online (Sandbox Code Playgroud)
欲了解更多信息,请阅读以下内容:https : //developer.wordpress.org/themes/basics/main-stylesheet-style-css/
| 归档时间: |
|
| 查看次数: |
12731 次 |
| 最近记录: |