Support » Fixing WordPress » HTTPS problems while theme has wp_deregister_style/wp_enqueue_script for guest

  • 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 1 month, 2 weeks ago by  narwen.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.