【问题标题】:Stylesheet Missing From Wordpress Theme BonesWordpress 主题骨骼中缺少样式表
【发布时间】:2016-05-06 20:10:55
【问题描述】:

过去几周一直在开发网站。直到今天都没有问题,当我加载网站时,它说主题已安装但不完整,缺少样式表。这张图片显示了我的问题:http://i.stack.imgur.com/QZoQR.png

我进入我的服务器上的 style.css 并没有发现任何错误。这是 style.css 文件的前几行:http://i.stack.imgur.com/xRB8P.jpg

有谁知道解决这个问题,因为该网站不适合我,需要尽快完成。

【问题讨论】:

    标签: css wordpress


    【解决方案1】:

    在您的 style.css 中,您缺少 WordPress 加载主题所需的信息。以下是来自 Codex 的示例:https://codex.wordpress.org/Theme_Development

    /*
    Theme Name: Twenty Thirteen
    Theme URI: http://wordpress.org/themes/twentythirteen
    Author: the WordPress team
    Author URI: http://wordpress.org/
    Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
    Version: 1.0
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: 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: twentythirteen
    
    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.
    */
    

    你至少需要有Theme Name

    【讨论】:

      【解决方案2】:

      在您的屏幕截图中,您的文件名似乎是 style 而不是 style.css

      另外,我没有看到 WordPress 加载主题所需的信息,请参阅此处https://codex.wordpress.org/Theme_Development#Theme_Stylesheet

      【讨论】:

        【解决方案3】:

        /*
        Theme Name: Name for your theme
        Theme URI: URL you want for your theme 
        Author: Your name 
        Author URI: Your URL
        Description: Description about your theme like theme for vibe-uk.com etc.
        Version: Specify version
        */

        至少在 style.css 文件中提供上述信息,这就是 WordPress 识别主题名称和缩略图的方式,以便在主题根目录中显示上传 screenshot.png

        【讨论】:

          猜你喜欢
          • 2012-07-02
          • 1970-01-01
          • 2014-04-14
          • 1970-01-01
          • 2015-03-17
          • 1970-01-01
          • 2015-09-29
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多