• Plugin Author SilkyPress

    (@diana_burduja)


    In case you’re having a white overlay over the editor where you want to write your CSS or JS code, please open a support ticket where you include the name of your theme and a list of active plugins on your website.

    This is usually caused by an incompatibility with another plugin that is probably using the CodeMirror editor, just like the Simple Custom CSS and JS plugin does. I’m interesting in solving these sort of incompatibilities, so other users doesn’t experience the same problem as you do.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello.

    I am having this problem.

    I am using Phlox Theme.

    plugins:
    Advanced TinyMCE Configuration
    Cloudflare
    Code Snippets
    CSS Plus
    Jetpack by WordPress.com
    Livemesh SiteOrigin Widgets
    Loginizer
    Master Slider Pro
    Microthemer
    Page Builder by SiteOrigin
    Phlox Core Elements
    Post Snippets
    Reusable Content & Text Blocks by Loomisoft
    SEO by SQUIRRLY
    SG Optimizer
    SiteOrigin Premium
    SiteOrigin Widgets Bundle
    Sticky Menu (or Anything!) on Scroll
    TinyMCE Advanced
    Website Tools by AddThis
    WP Dashboard Notes
    WP Rollback
    WPML Multilingual CMS
    WPML String Translation

    thanks,
    .pat

    Plugin Author SilkyPress

    (@diana_burduja)

    Hello Pat,

    in your case it seems to be due to the CSS Plus plugin. We’ll try within the next days to make a compatibility for the plugins, if that is possible.

    Thank you for informing me about it and for sharing the list of active plugins.

    Plugin Author SilkyPress

    (@diana_burduja)

    Hi Pat,

    would you please update to the 3.6 version and see if the problem is solved?

    Hello Diana.

    That did it! It works now. Thank you. I had too much code in the other plugin to easily deactivate it.

    all the best,
    .p

    Hi Diana Burduja.

    I ran into a related problem where my child-theme was using code-mirror. At first I tried to just dequeue all the CodeMirror scrips loaded by “Simple Custom CSS and JS”. This worked fine untill I realized that in “ccj_admin.js”, not only the editor is initialized, but there is also other functions for your plugin.

    Would be great if you can put your CodeMirror “initialization” in a separate file, so if we need to we can just completely dequeue your CodeMirror scripts and styles.

    I did get it all working though, letting your CodeMirror load, and preventing my by using a ‘if’ function before I enqueued my CodeMirror scripts and styles like this:

    if (!wp_script_is( 'ccj_admin', $list = 'enqueued' )) {
       //"Simple Custom CSS and JS" is not loaded here
    }

    Note the above was inside:
    add_action( 'admin_enqueue_scripts', 'enqueue_codemirror_scripts' );

    Thanks!
    Reinhard

    Plugin Author SilkyPress

    (@diana_burduja)

    Hello Reinhard,

    would you please let me know what theme and child-theme are you using? Maybe I can have a look into it.

    The CodeMirror library loaded by the Simple Custom CSS and JS plugin is limited only to the “Add Custom Code” admin pages. I find this a good practice in order to avoid any conflicts with other plugins.

    I would suggest to you to limit the theme’s JS and CSS assets to only required admin pages. This is definitely an easier solution to your problem.

    You can check the theme’s admin_enqueue_scripts hook and write the following at the beginning of the function:

            $screen = get_current_screen();
    
            // Not for custom-css-js post type
            if ( $screen->post_type == 'custom-css-js' )
                return false;
    

    Here is how it’s supposed to look like:

    
    add_action('admin_enqueue_scripts', 'child_theme_admin_enqueue_script');
    function child_theme_admin_enqueue_script() {
            $screen = get_current_screen();
    
            // Not for custom-css-js post type
            if ( $screen->post_type == 'custom-css-js' )
                return false;
    
            // The rest of the function's code ...
    }
    

    Thank you Diana that is going to work perfectly. It is just a custom child theme that I am busy making for Genesis, and I loaded CodeMirror onto all post.php pages. I didn’t think about using “post_type == ‘custom-css-js'”, that feels so much cleaner than checking if a script is enqueued. Also thank you for the great plug-in.

    cprlrst

    (@cprlrst)

    Please delete

    • This reply was modified 7 years ago by cprlrst.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Read this BEFORE POSTING’ is closed to new replies.