突然之间,我的孩子主题.css被忽略了?它已经正常工作了几个月了?

时间:2019-01-14 作者:user7663911

有人知道这是什么原因吗?

谢谢

https://www.subscriptionboxaustralia.com/directory/

1 个回复
SO网友:Remzi Cavdar

必需的(子)主题文件检查子主题是否有

风格。css功能。php屏幕截图。png(可选,但可帮助您区分)推荐的basicfunctions.php 对于子主题

<?php
/**
 * Example child theme Remzi Cavdar
 *
 * @link https://developer.wordpress.org/themes/advanced-topics/child-themes/
 *
 * 
 */


function use_parent_theme_stylesheet() {
    // Use the parent theme\'s stylesheet
    return get_template_directory_uri() . \'/style.css\';
}

function child_theme_branding() {

    // Uncomment this if you want versioning in your child theme stylesheet
    // $themeVersion = wp_get_theme()->get(\'Version\');

    // Enqueue our style.css with our own version
    wp_enqueue_style( \'child-theme-branding\', get_stylesheet_directory_uri() . \'/style.css\', array(), null );

}

// Filter get_stylesheet_uri() to return the parent theme\'s stylesheet
add_filter( \'stylesheet_uri\', \'use_parent_theme_stylesheet\' );

// Enqueue this theme\'s scripts and styles (after parent theme)
add_action( \'wp_enqueue_scripts\', \'child_theme_branding\', PHP_INT_MAX );