WordPress.org

Ready to get started?Download WordPress

Forums

Problem concerning SSL and get_the_post_thumbnail? (5 posts)

  1. Pallando
    Member
    Posted 2 years ago #

    Has anyone encountered a problem with get_the_post_thumbnail on a ssl site?

    It was throwing out non-secure image links. I solved the problem with a manual php function on our site already.

    The question now is if it was a singular problem with the child theme or setup or if it's a general problem/bug.

  2. Which theme? I just tried the SSL version of my test blog and the thumbnail is via an SSL URL.

    My theme does thumbnails differently so I want to see if I can reproduce it on my Crash Test Dummy blog.

  3. Pallando
    Member
    Posted 2 years ago #

    Twenty Eleven (in a self-created child theme where no changes where made concerning the thumbnails)

  4. Switching the Crash Test Dummy to Twenty Eleven... Done. Huh, it's doing the same thing.

    Okay, I see what's happening. My post has the image saved with the http:// while before my old theme was showing the thumbnail in the excerpt. That thumbnail was dynamic and was getting https://.

    Just for giggles I used the search and replace plugin and replaced all of my blog URLs with the https:// version (it is a crash test dummy after all).

    That, with also setting the WordPress URL and Site URL to the https, made almost everything on my blog SSL based. Internet Explorer still complained because not quite 100% of all the URLs were SSL based but when I told it not to load the unencrypted URLs I couldn't notice anything missing.

    Not sure that counts as a bug exactly, but if you have a work around that's probably good.

  5. Dave Ross
    Member
    Posted 1 year ago #

    I know I'm late to the party here, but I just had the same issue. Solved it by using protocol relative URLs for my WP_HOME and WP_SITEURL in wp-config.php. So something like:

    define('WP_HOME','//www.example.com');
    define('WP_SITEURL','//www.example.com');

    It comes down to how wp_upload_dir() builds URLs for post attachments. It's just using the info we gave it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags