Switching to SSL causes thumbnails not to load
-
I recently moved my WP-enabled site to SSL. Everything went fine, but RPT began showing the default thumbnail for all related posts. I found this old post suggesting the problem was due to not searching for both https:// and https:// as the scheme when scanning the post content for the first image URL.
This is my problem as well. I didn’t opt to go the full route of the earlier poster’s patch, but in essence I followed the same idea:
$wud = wp_upload_dir(); $baseurl = $wud['baseurl']; $baseurl = str_replace('https://', 'https://', $baseurl); // search the first uploaded image in content preg_match_all( '|<img.*?src=[\'"](' . $baseurl . '.*?)[\'"].*?>|i', $post->post_content, $matches );
A more robust solution could be devised, but this solved my immediate problem and got my site looking right again.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Switching to SSL causes thumbnails not to load’ is closed to new replies.