markjaquith / WordPress-Skeleton

Basic layout of a WordPress Git repository. I use this as a base when creating a new repo.
1.85k stars 600 forks source link

Problem loading theme assets #92

Closed Gyroscopic closed 9 years ago

Gyroscopic commented 9 years ago

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 9 years ago

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