Custom Colors
We use our own system for Custom Colors. This system gets the main style CSS file content and creates new generated styles file under ../wp-content/uploads/ folder. If the Custom Colors system is not working on your site, you need to check below options:
- 1.Disable all caching and optimizing plugins in your site (CDN, CloudFlare, and Akamai systems also).
- 2.
- 3.Correct File Permissions for WordPress and uploads folder -https://codex.wordpress.org/Changing_File_Permissions.
- 4.
- 5.At the end, check if WP_Filesystem is working correctly. You can check it using below code in your functions.php. Ifprint_r() doesn't show any results,it means WP_Filesystem is not working on your site. In this case, you can contact your hosting providers with this issue.
global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once ABSPATH . '/wp-admin/includes/file.php'; WP_Filesystem(); } $style_css = $wp_filesystem->get_contents( get_template_directory() . '/style.css' ); print_r($style_css); //display style.css file content
global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php'; WP_Filesystem();
}
$style_css = $wp_filesystem->get_contents( get_template_directory() . '/style.css' ); print_r($style_css);
//display style.css file content
Last modified 3yr ago