If you’re working with Elementor and trying to customize typography or color schemes or Elementor Schemes Manager Error – “Elementor\Core\Schemes\Manager” in your WordPress theme, you might encounter the following fatal error:
PHP Fatal error: Uncaught Error: Class "Elementor\Core\Schemes\Manager" not found
This error usually means that the Schemes_Manager
class is either missing, not properly loaded, or Elementor is not yet fully initialized when your code runs. In this blog post, we’ll go over the possible causes of this issue and how to fix it effectively.
Understanding the Error
The error happens when your code tries to instantiate or access the Schemes_Manager
class before Elementor has fully loaded. This often occurs if your code is inside a custom plugin or theme functions file that runs too early in WordPress’s execution order.
Step-by-Step Fix
1. Ensure Elementor is Installed and Activated
The first thing to check is whether Elementor is properly installed and activated.
- Go to WordPress Dashboard > Plugins > Installed Plugins.
- Make sure Elementor (and Elementor Pro, if required) is activated.
If Elementor is missing, install it from the WordPress plugin repository.
2. Use the Correct Elementor API
Instead of manually creating an instance of Schemes_Manager
, you should use Elementor’s global plugin instance:
Replace This Code:
$schemes_manager = new Schemes_Manager();
With This:
$schemes_manager = \Elementor\Plugin::$instance->schemes_manager;
This ensures you’re accessing Elementor’s internal manager correctly.
3. Delay Execution Until Elementor is Loaded
Since Elementor is not available immediately when WordPress loads, your code should run only after Elementor is fully initialized.
add_action('elementor/loaded', function() { $schemes_manager = \Elementor\Plugin::$instance->schemes_manager; if ($schemes_manager) { $scheme_obj_typo = $schemes_manager->get_scheme('typography'); if ($scheme_obj_typo) { $scheme_obj_typo->save_scheme($theme_fonts); } $scheme_obj_color = $schemes_manager->get_scheme('color'); if ($scheme_obj_color) { $scheme_obj_color->save_scheme($theme_colors); } } else { error_log('Schemes Manager is not available.'); } });
This ensures Elementor is fully loaded before accessing schemes.
4. Define
$theme_fonts and
$theme_colors Before Using Them
If $theme_fonts
and $theme_colors
are undefined, save_scheme()
might cause an error.
Fix: Initialize the Variables Before Using Them
$theme_fonts = $theme_fonts ?? []; $theme_colors = $theme_colors ?? [];
Or manually define them:
$theme_fonts = [ 'primary_font' => 'Arial', 'secondary_font' => 'Helvetica' ]; $theme_colors = [ 'primary_color' => '#ff0000', 'secondary_color' => '#00ff00' ];
This prevents undefined variable errors.
5. Manually Load Elementor Core (If Necessary)
If Elementor is installed but the class is still missing, try manually including Elementor’s core files before accessing Schemes_Manager
.
Solution:
if (!class_exists('Elementor\Plugin')) { require_once ABSPATH . 'wp-content/plugins/elementor/includes/plugin.php'; }
This ensures Elementor’s plugin files are available before your code executes.
6. Debug by Checking the Available Classes
If the error persists, you can check whether Elementor\Core\Schemes\Manager
exists in the declared classes.
Solution: Log the Available Classes
error_log(print_r(get_declared_classes(), true));
Then, check wp-content/debug.log to see if Elementor\Core\Schemes\Manager
is listed.
Final Checklist to Fix the Error
- Ensure Elementor is installed and activated
- Use
\Elementor\Plugin::$instance->schemes_manager
instead ofnew Schemes_Manager()
- Wrap the code inside the
elementor/loaded
hook - Define
$theme_fonts
and$theme_colors
properly - Manually include Elementor’s core if necessary
- Log available classes to debug further
- Clear cache and test again
Conclusion
The Elementor Schemes Manager Error – “Class Elementor\Core\Schemes\Manager Not Found” error usually happens when Elementor is either not loaded yet or its API is being accessed incorrectly. By following the solutions outlined above, you can prevent this error and ensure smooth execution of your Elementor customization code.
Additionally, always make sure to keep your WordPress, Elementor, and custom plugins updated to their latest versions, as outdated files can sometimes cause compatibility issues. If you are using a child theme or custom plugin, verify that there are no conflicts with other plugins by deactivating them temporarily and testing your code.
If the problem persists despite trying all these solutions, consider checking Elementor’s documentation or reaching out to their support forums for further assistance. Debug logs can provide valuable insights into what’s happening behind the scenes, so make sure to enable logging in wp-config.php
if needed.
Tada… Your website is back again to normal working state.
Try these fixes and let me know in the comments if you have any questions or additional insights! 🚀
Also, Read: