所以我是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.
*/发布于 2017-05-27 23:58:01
只是为了好玩。不要添加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
*/当一个主题没有出现时,通常会在主题管理中出现下面显示的错误。
发布于 2017-05-28 00:06:50
除了图像和JavaScript文件之外,WordPress主题通常还包括三种主要类型的文件。
1名为style.css的.The样式表,它控制网站页面的呈现(视觉设计和布局)。
2个.WordPress模板文件,用于控制站点页面从WordPress数据库生成要在站点上显示的信息的方式。
3作为WordPress主题文件的一部分的.The可选函数文件(functions.php)。
示例:-
按照wp-content > themes的路径到达themes文件夹。您将看到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/
发布于 2019-11-29 01:47:36
检查主题文件是否具有正确的文件权限和所有权。
CD到您网站的根目录,如果您的服务器在Ubuntu上运行Apache,则可以使用以下命令设置所有权: chown www-data:www-data -R *
或者对于CentOS上的Apache : chown apache:apache -R *
和权限:
查找。-type d -exec chmod 755 {} \;#更改目录权限
查找。-type f -exec chmod 644 {} \;#更改文件权限
https://stackoverflow.com/questions/44218793
复制相似问题