Problem loading theme assets
Closed this issue · 1 comments
Gyroscopic commented
Hi I have wordpress-skeleton in a subfolder of a site eg http://site.com/site/
wp setup ran ok and site is visible in the above url BUT no styles are loaded for either the theme or plugins (same for js).
When I look at the css url it is missing the' /site/' subfolder eg
http://site.com/content/themes/mytheme/dist/styles/main.css
I have the following in wp-config.php
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/site/wp');
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] . '/site/');
How come the theme (& plugins) asset paths are not correctly set?
Gyroscopic commented
Ok found a fix for this. In wp-config.php around line 21-22
#if (!defined('WP_CONTENT_URL')) define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/content' );
define('WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/site/content'); # fix for wrong path above