Title: HTTPS problems while theme has wp_deregister_style/wp_enqueue_script for guest
Last modified: October 5, 2017

---

# HTTPS problems while theme has wp_deregister_style/wp_enqueue_script for guest

 *  Resolved [narwen](https://wordpress.org/support/users/narwen/)
 * (@narwen)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/https-problems-while-theme-has-wp_deregister_style-wp_enqueue_script-for-guest/)
 * 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 8 years, 8 months ago by [narwen](https://wordpress.org/support/users/narwen/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [narwen](https://wordpress.org/support/users/narwen/)
 * (@narwen)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/https-problems-while-theme-has-wp_deregister_style-wp_enqueue_script-for-guest/#post-9560776)
 * 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.

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [narwen](https://wordpress.org/support/users/narwen/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/https-problems-while-theme-has-wp_deregister_style-wp_enqueue_script-for-guest/#post-9560776)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
