php - 当我安装融合生成器时,它在主页上显示“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();
}
我该如何解决这个问题?
解决方案
$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
推荐阅读
- emacs - 有没有办法设置标记,然后将输入的字符包含在区域中?
- python - 在 pandas 中创建新列,该列将根据条件获取值
- python - 同时运行 pytest 脚本与不同的发生
- javascript - 如何在 JS 中用对象元素填充 CSV 文件
- flutter-web - Flutter Web 本地存储
- javascript - JSX 元素属性不随 onChange 改变
- ansible - 使用 Ansible 计算时使用的磁盘空间百分比不正确
- angular - 使用自定义指令 Angular 6 显示/隐藏 div
- python - 根据月份从数据框中删除列?
- rest - 语音分析 自动语音识别、多说话人分离、情绪、说话人重叠