Title: Incompatible with &#039;WordPress HTTPS (SSL)&#039;
Last modified: August 20, 2016

---

# Incompatible with 'WordPress HTTPS (SSL)'

 *  Resolved [Kristof from Habitgrowth](https://wordpress.org/support/users/chris_maes/)
 * (@chris_maes)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/incompatible-with-wordpress-https-ssl/)
 * I’m using WordPress 3.5 and the plugins **related posts thumbnails** and **wordpress
   https (ssl)**.
 * What **wordpress https (ssl)** does is put https links to images in the posts
   and when the posts are viewed over non-ssl connections they are renamed to http.
 * **related posts thumbnails** shows default thumbnail for these images as it searches
   on for the baseurl ([http://&#8230](http://&#8230);)
 * I could solve this however by adding a few lines of code. What it basically does
   is switch http to https and vice versa and do another search in case no images
   were found in the baseurl. in my case the [https://&#8230](https://&#8230); images
   are found and the plugin shows the correct http:// image.
 * I have posts that were created with and without **wordpress https (ssl)** and
   it now works for all images.
 * Do you think you could include my code (or something similar) into any next releases?
 *     ```
       if(!isset($matches[1][0])){
       						$debug .= 'No image was found in '.$wud['baseurl'].';';
       						$baseurl=$wud['baseurl'];
       						// switch https for http and vice versa
       						if(strtolower(substr($baseurl,0,5))=='https'){
       							// switch from https to http
       							$baseurl=str_replace('https:', 'http:', $baseurl);
       						}else{
       							// switch from http to https
       							$baseurl=str_replace('http:', 'https:', $baseurl);
       						}
       						$debug .= 'Trying to search again in '.$baseurl.';';
       preg_match_all( '|<img.*?src=[\'"](' . $baseurl . '.*?)[\'"].*?>|i', $post->post_content, $matches);
       					}
       ```
   
 * PS: The debug option was VERY helpful, thank you for that!
 * [http://wordpress.org/extend/plugins/related-posts-thumbnails/](http://wordpress.org/extend/plugins/related-posts-thumbnails/)

The topic ‘Incompatible with 'WordPress HTTPS (SSL)'’ is closed to new replies.

 * ![](https://ps.w.org/related-posts-thumbnails/assets/icon-256x256.png?rev=1602092)
 * [Related Posts Thumbnails Plugin for WordPress](https://wordpress.org/plugins/related-posts-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/related-posts-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/related-posts-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/related-posts-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/related-posts-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/related-posts-thumbnails/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [Kristof from Habitgrowth](https://wordpress.org/support/users/chris_maes/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/incompatible-with-wordpress-https-ssl/)
 * Status: resolved