Support » Plugin: Related Posts Thumbnails Plugin for WordPress » 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://…)

    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://… 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?

    						$debug .= 'No image was found in '.$wud['baseurl'].';';
    						// switch https for http and vice versa
    							// switch from https to http
    							$baseurl=str_replace('https:', 'http:', $baseurl);
    							// 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!

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