wordpress自定义主题不出现在仪表板中

时间:2017-05-27 15:46:19

标签: php html css wordpress wordpress-theming

所以我是wordpress的新手,我刚刚在我的wp-content / themes / mytheme中为我的wordpress项目创建了一个自定义主题,我将index.php,blog.css和style.css文件添加到新主题但是当我在仪表板中转到主题,新创建的主题不会显示为选项。 我还缺少什么? 感谢

的style.css

/*
Theme Name: Start WordPress
Theme URI: http://wordpress.org/themes/startwordpress
Author: Me
Author URI: http://wordpress.org/
Description: The Start WordPress theme is my first custom theme.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: bootstrap, black, brown, orange, tan, white, yellow, light, one-
column, two-columns, right-sidebar, flexible-width, custom-header, 
custom-menu, editor-style, featured-images, microformats, post-
formats, rtl-language-support, sticky-post, translation-ready
Text Domain: startwordpress

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.
*/

4 个答案:

答案 0 :(得分:0)

只是为了好玩。不要添加blog.css。

只需使用style.css和基本文件,直到看到它为止。在进行故障排除时 - 只需使用index.php和style.css - 并保持修剪。

https://codex.wordpress.org/Theme_Development#Basic_Templates

/*
Theme Name: Example theme name
Theme URI: n/a
Author: you
Author URI: n/a
Description: example description...
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: example-tag
*/

如果主题没有显示,主题管理员中通常会显示以下错误。

答案 1 :(得分:0)

除了图像和JavaScript文件之外,WordPress主题通常包含三种主要类型的文件。

1.名为style.css的样式表,用于控制网站页面的显示(视觉设计和布局)。

2.WordPress模板文件,用于控制网站页面生成WordPress数据库信息的方式,以便在网站上显示。

3.可选函数文件(functions.php)作为WordPress主题文件的一部分。

示例: -

遵循wp-content>的路径主题到达您的主题文件夹。你会看到WordPress的默认主题 - 二十五,二十四,二十三 - 和index.php。为您的主题创建一个新目录;我叫我的startwordpress。

/*
Theme Name: Start WordPress
Author: Tania Rascia
Description: Bootstrap Blog template converted to WordPress
Version: 0.0.1
Tags: bootstrap
*/

只需点击此链接https://www.taniarascia.com/developing-a-wordpress-theme-from-scratch/

即可

答案 2 :(得分:0)

检查主题文件是否具有正确的文件权限和所有权。

CD到网站的根目录,然后可以使用以下命令设置所有权(如果服务器在Ubuntu上运行Apache): chown www-data:www-data -R *

或者对于CentOS上的Apache: chown apache:apache -R *

权限:

查找。 -type d -exec chmod 755 {} \; #更改目录权限

查找。 -类型f -exec chmod 644 {} \; #更改文件权限

答案 3 :(得分:-1)

带上包含主题信息的样式文件