WordPress Not Loading CSS, JS

Issue: WordPress website displays properly without SSL (https). When using https:// to visit site in web browser, styling and other elements are not working, and therefore not loading.

Solution: SSL needs to be defined in config.php file using the below example (on line number 3 and 5):

// Blog Address and Site Address (improves performance less db calls)
//define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST'].'/'); // blog url
define( 'WP_HOME', 'https://www.DOMAINNAME.com' );
//define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST'].'/'); // site url
define( 'WP_SITEURL', 'https://www.DOMAINNAME.com' );

Test and see if the SSL version of website is working. Sometimes the additional action of forcing SSL is needed in the functions.php file of the active theme. If this extra stetting is required, here’s the code:

define('FORCE_SSL_ADMIN', true);

Verify that none of the CSS or JS is hard coded in the active theme or its functions.php, to use http.
Change all the URLs in the post_content table to use https, as well as changing any http usage in text widgets (to use https instead).

Leave a comment

BlogLogistics