Title: Not working in https
Last modified: February 14, 2017

---

# Not working in https

 *  Resolved [pugman76](https://wordpress.org/support/users/pugman76/)
 * (@pugman76)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/not-working-in-https/)
 * I switched my website to https, and when you click an image, the lightbox does
   not show up (it just goes to a black screen with a loading icon that keeps spinning).
   I switched it back to http, and it worked. Anyone know the trick on how to get
   it working with https?
 * Thanks!

Viewing 1 replies (of 1 total)

 *  [Marcos Nobre](https://wordpress.org/support/users/onyx808/)
 * (@onyx808)
 * [9 years ago](https://wordpress.org/support/topic/not-working-in-https/#post-9196307)
 * I had the same issue, fixed by adding the following code to the functions.php
   file
 *     ```
       function _bd_force_https()
       {
           if ( empty( $_SERVER['HTTPS'] ) ) return;
           ob_start();
       }
       add_action( 'template_redirect', '_bd_force_https', 1 );
   
       function _bd_output_https_page()
       {
           if ( empty( $_SERVER['HTTPS'] ) ) return;
           echo str_ireplace( 'http://', 'https://', ob_get_clean() );
       }
       add_action( 'wp_footer', '_bd_output_https_page', 99 );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Not working in https’ is closed to new replies.

 * ![](https://ps.w.org/buddypress-media/assets/icon-256x256.png?rev=3219705)
 * [rtMedia for WordPress, BuddyPress and bbPress](https://wordpress.org/plugins/buddypress-media/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddypress-media/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddypress-media/)
 * [Active Topics](https://wordpress.org/support/plugin/buddypress-media/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddypress-media/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddypress-media/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Marcos Nobre](https://wordpress.org/support/users/onyx808/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/not-working-in-https/#post-9196307)
 * Status: resolved