【问题标题】:Wordpress child theme styles over ridden by parent theme stylesWordpress 子主题样式被父主题样式覆盖
【发布时间】:2013-07-13 16:13:14
【问题描述】:

我正在尝试为主题 designfolio 开发一个子主题,为此我创建了一个名为“mychild”的文件夹并将 style.css 放入其中,如主题/mychild/style.css。

/*
Theme Name:     proudeon
Theme URI:      http: //www.presscoders.com/designfolio
Description:    Child theme for the Designfolio theme
Author:         sunilkumar
Author URI:     http: //www.presscoders.com/
Template:       designfolio
Version:        0.1.0
*/

@import url("../designfolio/style.css");
#header {
height: 450px;
border:1px solid red;
}
#header-container, .footer-widget-container{
background: none repeat scroll 0 0 red;     
}

但是这些变化没有反映出来。我已经成功安装了子主题,我可以从 wordpress 编辑器编辑我的子主题 style.css。

我可以从 firebug inspect 元素中看到新的子样式,但它不是活动的。当我从 firebug inspect element 隐藏父样式时,我可以看到站点中反映的新样式。

请帮我找出问题

谢谢 骄傲

【问题讨论】:

    标签: wordpress themes wordpress-theming customization


    【解决方案1】:

    尝试在每个样式行中添加 !important。

    例如:

    #header {
    height: 450px !important;
    border:1px solid red !important;
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-07
    • 1970-01-01
    • 1970-01-01
    • 2018-01-02
    • 1970-01-01
    • 2020-12-04
    • 2014-10-13
    相关资源
    最近更新 更多