• Resolved narwen

    (@narwen)


    Hello!

    Recently I’ve moved to https and got problem with mixed content on frontpage for guest users only if theme’s functions.php contain some deregister functions.

    For example, if I put:

    // CDN Jquery вместо встроенного
    function cdn_jquery() {
    	wp_deregister_script( 'jquery' );
    	wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js', false, '2.2.4');
    	wp_enqueue_script( 'jquery' );
    }    
    add_action( 'wp_enqueue_scripts', 'cdn_jquery' );

    or/and

    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    function my_deregister_styles() {
        wp_deregister_style( 'wp-polls' );
        wp_deregister_style( 'wp-color-picker' );
        wp_deregister_style( 'basic-comment-quicktags' );
        wp_dequeue_style('yarppWidgetCss');
        wp_dequeue_style('jquery-lazyloadxt-spinner-css');
        wp_dequeue_style('a3a3_lazy_load');
    }

    I got mixed content due to all scripts and styles of plugins (including wp-emoji-release.min.js and wp-mediaelement.min.js) referring to http.

    Without wp_deregister_style/wp_enqueue_script, on non-frontpage and for non-guest users everything fine. I’m caching via server nginx itself, so it couldn’t be a problem of caching plugin.

    Please, help!

    • This topic was modified 7 years, 5 months ago by narwen.
Viewing 1 replies (of 1 total)
  • Thread Starter narwen

    (@narwen)

    So, I’ve just add:
    $_SERVER['HTTPS'] = 'on';
    in wp-config.php and problem gone.

Viewing 1 replies (of 1 total)
  • The topic ‘HTTPS problems while theme has wp_deregister_style/wp_enqueue_script for guest’ is closed to new replies.