【问题标题】:Child theme style.css from parent doesn't transfer来自父级的子主题 style.css 不会转移
【发布时间】:2015-09-26 18:22:10
【问题描述】:

我对 WordPress 比较陌生,并且正在使用 ThemeForest 的主题,它是构建器响应式多用途主题。我创建了子主题,从仪表板中选择并激活了它。我遇到的问题是页眉、菜单和页脚区域的样式格式不会转移到子主题。

我的网站是 brewer2inspect.com

我将子主题放在 /wp-content/themes 下,并将其命名为 builder-child。您将在下面找到我的新 style.css 文件的代码,该文件位于 builder-child 目录中。

/*
Theme Name:   Builder Child
Theme URI:    http://brewer2inspect.com/builder-child/  
Description:  Builder Child Theme
Author:       Mark G
Author URI:
Template:     builder
Version:      1.0.0
*/

// This @import line loads the stylesheet from the parent theme*/
@import url('../builder/style.css');

/* =Theme customization starts here ------- */

当这不起作用时,我查看了原始或父 style.css 并尝试更改导入以将该文件反映为以下也不起作用的文件。

@import url('assets/css/bootstrap.css');
@import url('assets/css/bootstrap-responsive.css');
@import url('assets/css/docs.css');
@import url('assets/js/google-code-prettify/prettify.css');
@import url('assets/nivo/nivo-slider.css');
@import url('assets/css/prettyPhoto.css');
@import url('assets/css/options.css');

【问题讨论】:

  • 叫做builder。父主题全部使用小写字母。

标签: html css wordpress parent-child stylesheet


【解决方案1】:

只是检查 - 您的父主题是“builder”还是“Builder”?导入路径区分大小写。

【讨论】:

  • 此外,codex 指出导入父主题样式表不再是最佳做法:[link] (codex.wordpress.org/Child_Themes)
  • 或者...尝试更改行中的开始 // 注释标记 '//此@import 行将样式表从父主题 /' 加载到 /。 (或者或者删除结尾 */)
猜你喜欢
  • 2021-04-18
  • 1970-01-01
  • 2015-05-16
  • 2017-02-19
  • 2019-10-13
  • 2021-01-16
  • 1970-01-01
  • 2021-12-02
  • 2019-02-28
相关资源
最近更新 更多