【问题标题】:Custom Theme not showing in WordPress Dashboard自定义主题未显示在 WordPress 仪表板中
【发布时间】:2023-01-12 19:36:42
【问题描述】:

我正在尝试创建自定义 Wordpress 主题。

我使用 MAMP 在本地设置了 wordpress,并按照说明将所有 wordpress 文件粘贴到 htdocs 中。

我的 style.css 和 index.php 文件在 htdocs/wp-content/themes/new-theme 中。

有任何想法吗?我假设我在本地错误地设置了 WP,因此我的新主题没有出现在仪表板中:

样式.css:

/*
Theme Name: Example theme name
Theme URI: n/a
Author: LinusMjorn
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
*/

我没有多站点设置,以下问题的答案也无济于事。

wordpress custom theme not appearing in dashboard

谢谢

【问题讨论】:

  • 您是否打开了 WordPress 和 PHP 错误报告?

标签: php wordpress wordpress-theming


【解决方案1】:

对于主题开发,请参考此链接,它可以帮助您
https://developer.wordpress.org/themes/basics/main-stylesheet-style-css/

这是代码

 /*
    Theme Name: theme name
    Theme URI: https://example.com/
    Author: theme-developer
    Author URI: https://example.com/
    Description: Theme Description....
    Version: 1.3
    Requires at least: 5.0
    Tested up to: 5.4
    Requires PHP: 7.0
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Text Domain: your-theme
    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.
    */

这是 style.css 的示例,WordPress 将主题模板文件集识别为有效主题

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2016-12-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-28
  • 1970-01-01
  • 2014-01-23
  • 1970-01-01
相关资源
最近更新 更多