首页 > 解决方案 > 当我安装融合生成器时,它在主页上显示“avada Fusion_Dynamic_CSS_Helpers::get_dynamic_css_id()”

问题描述

这是完整的错误信息

致命错误:在 C:\wamp\www\softtech\wp-content\plugins\fusion-builder\inc\lib\inc\class-fusion-dynamic-css-file.php 中调用未定义的方法 Fusion_Dynamic_CSS_Helpers::get_dynamic_css_id()在第 112 行

这是112行的文件代码。如何解决这个问题。我尝试从文件中删除所有代码,但它产生了更多错误。

    public function file( $target = 'path' ) {

    // Get the blog ID.
    $blog_id = '';
    // If this is a multisite installation, append the blogid to the filename.
    if ( is_multisite() ) {
        $current_site = get_blog_details();
        if ( $current_site->blog_id > 1 ) {
            $blog_id = "_blog-{$current_site->blog_id}";
        }
    }

    $fusion_library = Fusion::get_instance();
    $id             = $this->dynamic_css->get_helpers()->get_dynamic_css_id();
    $file_name      = "{$id}.min.css";
    if ( $blog_id ) {
        $file_name = "{$blog_id}-{$id}.min.css";
    }

    if ( 'filename' === $target ) {
        return $file_name;
    }

    $file = new Fusion_Filesystem( $file_name, 'fusion-styles' );

    // Return the path or the URL
    // depending on the $target we have defined when calling this method.
    if ( 'path' === $target ) {
        return $file->get_path();
    }
    return $file->get_url();

}

我该如何解决这个问题?

标签: phpwordpressfatal-error

解决方案


$this->dynamic_css->get_helpers()->get_dynamic_css_id()第112 行:get_helpers()来自wp-content/themes/Avada/includes/lib/inc/class-fusion-dynamic-css.php,这个文件有方法

public function get_helpers() { // Instantiate the Fusion_Dynamic_CSS_Helpers object. if ( null === $this->helpers ) { $this->helpers = new Fusion_Dynamic_CSS_Helpers(); } error_log(print_r(get_class_methods($this->helpers), true)); return $this->helpers; }

问题是Fusion_Dynamic_CSS_Helpers与插件冲突fusion-builder。所以,我通过导入 require_once ABSPATH . 'wp-content/plugins/fusion-builder/inc/lib/inc/class-fusion-dynamic-css-helpers.php';包含该方法的方法解决了这个问题get_dynamic_css()

快速回答

require_once ABSPATH . 'wp-content/plugins/fusion-builder/inc/lib/inc/class-fusion-dynamic-css-helpers.php';在开头插入wp-content/themes/Avada/includes/lib/inc/class-fusion-dynamic-css.php


推荐阅读