doulingzhuang3079 2019-03-05 20:16
浏览 64

Wordpress儿童主题style.css已停止工作

really hoping someone can please help me! I just updated the Divi parent theme on my Wordpress site (www.ellymacdonalddesign.com), and the child CSS theme seems to have stopped working.

I've tried the solutions from this question, but they do not seem to work for me: Wordpress child theme style.css not working

My child functions.php file is currently:

<?php
function my_theme_enqueue_styles() {
    $parent_style = 'divi-style'; 
    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( $child-style, get_stylesheet_uri() );
}
?>

Would really appreciate any guidance please, thank you in advance, Elly

  • 写回答

1条回答 默认 最新

  • duanniying2342 2019-03-06 03:15
    关注

    Is your variable $child-style have any value? According to document, the handle name (first parameter) is required. That's why your child theme still not working.

    Try below code to see if it's work:

    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
        $parent_style = 'divi-style'; 
        $child_style = 'divi-style-child'; 
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( $child_style, get_stylesheet_uri() );
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比