2022-04-18

如何解決 Elementor 編輯區無法載入:Uncaught Error: Class 'Elementor\Scheme_Color' not found

之前解掉 Fatal error: Uncaught Error: Class 'Elementor\Scheme_Color' not found 的錯誤。殊不知製造另一個問題,變 Elementor 編輯區會一直轉圈圈無法載入,開啟 wp-debug 查原因,兇手是 Fatal error: Uncaught Error: Class ‘Elementor\Scheme_Color’ not found.

解決方式

在 wp-content > mu-plugins 裡新增一個 schemefix.php。如果 wp-content 裡找不到 mu-plugins 資料夾,就自己建立。最後在 schemefix.php 貼上以下程式碼:

<?php
/**
* Plugin Name: Elementor Scheme_Color/Scheme_Typography Class Issue
**/

namespace Elementor;

add_action(
‘plugins_loaded’,
function() {
if ( ! class_exists( ‘Elementor\Scheme_Color’ ) ) {
class Scheme_Color extends Core\Schemes\Color {}
}
}
);
add_action(
‘plugins_loaded’,
function() {
if ( ! class_exists( ‘Elementor\Scheme_Typography ‘ ) ) {
class Scheme_Typography extends Core\Schemes\Typography {}
}
}
);

完成後儲存會像這樣:

回到管理後台,注意外掛的分類會多一個 [強制使用],就是強制執行 schemefix.php 這隻程式來跳過載入elementor Scheme_Color 或 Scheme_Typography,解決編輯區一直卡住無法載入的問題囉 😎

參考文章:WordPress error with Elementofatal-error-uncaught-error-class-elementorscheme_color-not-found

請我喝杯咖啡吧 ^^

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

PeiYing Tsai
author
愛藝術,喜歡以科技解決問題的數位產品設計師。 堅持信念,任何困難事,必有搞定的一天,Just try it! 隨手紀錄日常學習到的知識心得,希望對妳/你有幫助。
coffee-cup linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram