This error seems to become more and more popular nowadays:
I’ve tried a lot of ways and these are steps you should do to solve this case.
Step 1: Open file wp-config.php
You can open directly on your cpanel or direct admin or via FTP to edit.
Step 2: Add the following code
define('WP_HOME','https://yourdomain.com'); define('WP_SITEURL','https://yourdomain.com'); define('FORCE_SSL_ADMIN', true); if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
Remember to replace yourdomain.com to your domain.
The code should be added right below the first line.
Step 3: Save the file and Refresh your page.