虽然上载成功,但报告中断的主题事件

时间:2018-09-23 作者:Jonathan Brown

我不知道安装报告成功时缺少什么,但主题页面报告的主题已损坏。样式。css和函数。php包含在下面。

提前感谢您的帮助!

当我安装子主题时,它似乎找到了父主题。

Installing Theme from uploaded file: wp-velux-child.zip
Unpacking the package…

Installing the theme…

This theme requires a parent theme. Checking if it is installed…

The parent theme, Velux 1.1.3, is currently installed.

Theme installed successfully.
但主题页面报告主题被破坏

Broken Themes
The following themes are installed but incomplete.

Name    Description     
Velux Child The "velux" theme is not a valid parent theme.
样式。css:

/*
 Theme Name:   Velux Child
 Theme URI:    https://github.com/djjonbrown/wp-velux-child
 Description:  Velux Child Theme
 Author:       Jonathan Brown
 Author URI:   https://github.com/djjonbrown/
 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:  velux
 Template:     velux
*/
功能。php

<?php
function my_theme_enqueue_styles() {

    $parent_style = \'velux\'; 

    wp_enqueue_style( $parent_style, get_template_directory_uri() . \'/style.css\' );
    wp_enqueue_style( \'child-style\',
        get_stylesheet_directory_uri() . \'/style.css\',
        array( $parent_style ),
        wp_get_theme()->get(\'Version\')
    );
}
add_action( \'wp_enqueue_scripts\', \'my_theme_enqueue_styles\' );
?>

1 个回复
SO网友:Arthur Avary

据我所知,Velux是初级主题中的一个儿童主题。我只是犯了同样的错误。。。Velux不是有效的父主题,因为它是子主题!

结束

相关推荐

Custom WordPress Installation

我想知道下面的帖子中描述的自定义WordPress安装的方法是否有更新版本。http://wpbits.wordpress.com/2007/08/10/automating-wordpress-customizations-the-installphp-way/