0

Setup

Hi Guys! I have a weird issue. I'm using wordpress Premium BeTheme with ssl certificate installed.

Problem

The Problem is although images are uploading on the site with https but they are not displaying. If I switch the URL of the images from https to http manually they start to show.

What I have done?

I have tried unistalling ssl certificate and pretty much every solution on internet but it's not resolving.

Here is the URL of the website : https://uptimeelite.com/

6
  • define('WP_HOME','https://example.com'); define('WP_SITEURL','https://example.com'); replace the URL and place them in the wp-config
    – BlueSuiter
    Commented Dec 21, 2017 at 10:59
  • I have already done this.
    – naan
    Commented Dec 21, 2017 at 11:00
  • place them after WP_DEBUG
    – BlueSuiter
    Commented Dec 21, 2017 at 11:00
  • still not solved the problem
    – naan
    Commented Dec 21, 2017 at 11:08
  • In case if the Images are coming from widgets, I think you have to update them manually.
    – BlueSuiter
    Commented Dec 21, 2017 at 11:17

1 Answer 1

0

Place this code in your functions.php. It will filter all of the content before serving on application layer.

<?php
    function filterContent($content)
    {
        $upateURL = array
            (
            'http://www.example.com/wp-content/uploads' => 'https://www.example.com/wp-content/uploads',
        );

        foreach ($upateURL as $key => $value)
        {
            $content = str_replace($key, $value, $content);
        }
        return $content;
    }
    add_filter('the_content', 'filterContent');
?>
3
  • Thanks for your effect. But It's not working either. I have tried to add the code in functions.php file of theme and wordpress
    – naan
    Commented Dec 21, 2017 at 11:21
  • I am not aware of the built up of your code. Can you please share the code which is responsible for showing images on frontend.
    – BlueSuiter
    Commented Dec 21, 2017 at 11:23
  • Well I'm not quite sure where it is. As BeTheme and Wordpress have quite no. of files.
    – naan
    Commented Dec 21, 2017 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.