【问题标题】:wordpress css tries to load files from child theme instead of parentwordpress css 尝试从子主题而不是父主题加载文件
【发布时间】:2019-03-01 16:44:15
【问题描述】:

使用 29 主题,当我打开帖子时,Wordpress 会调用子主题目录中的 CSS 文件,结果出现 404 错误... 正确的文件位于父主题目录中,应该从那里调用。

functions.php 文件中的代码:

wp_enqueue_style( 'bootstrap', get_stylesheet_directory_uri() . '/bootstrap.css', array(), '4.3.1' );

Bootstrap 在子主题中正确加载,除非我打开帖子然后我收到 404 错误

【问题讨论】:

    标签: php wordpress


    【解决方案1】:

    请考虑使用

    wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/bootstrap.css', array(), '4.3.1' );
    

    并且,请确保您在文件顶部的 child-theme/style.css 中有 sting

    Template: twentynineteen
    

    【讨论】:

      猜你喜欢
      • 2017-06-15
      • 2021-12-02
      • 2019-02-28
      • 2017-02-14
      • 1970-01-01
      • 1970-01-01
      • 2018-04-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多