【问题标题】:Inherit the files from parent theme in WordPress从 WordPress 中的父主题继承文件
【发布时间】:2014-09-26 10:19:14
【问题描述】:

很长一段时间后,我再次制作 WordPress 子主题。我知道关于创建子主题需要了解的 WordPress 的每个部分。但是这次我无法制作继承父母主题的子主题。 我的情况发生了什么?

style.css 文件

/*
Theme Name: ifn child theme
Them URI: ifn.org.np
Description: This is child theme of ifn
Author:suku
Author URI:suku.com.np
Template: ifn
Version:1.0
*/
@import url('../ifn/style.css');

【问题讨论】:

  • 试试这个:@import url("../ifn/style.css");通过这个codex.wordpress.org/Child_Themes..it会帮助你
  • 很抱歉给您带来不便,因为我在将主题命名为 ifn-child 时犯了一个简单的错误。

标签: wordpress themes parent-child


【解决方案1】:

您还可以使用以下代码添加您的父样式表:-

add_action( 'wp_enqueue_scripts', 'load_my_styles' );
function load_my_styles() {
    wp_enqueue_style( 'parent-theme', get_template_directory_uri() . '/style.css' );
}

希望对你有帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-28
    • 1970-01-01
    • 2012-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多