I'm working on a WordPress project, starting from Mark Jaquith's WordPress-Skeleton repository, using MAMP.
I cloned the repo, updated the WordPress submodule, created a database and updated the local-config.php
file.
Everything seems to be fine so far, but when I try to use a different theme (placing it on /content/themes
), all the theme's assets get the wrong path (so the site is rendered with no images, no CSS and no JS). For example:
In the source code, a stylesheet link points to:
http://localhost/content/themes/roots/assets/css/main.min.css
when it should be:
http://localhost/lab/Wordpress-Skeleton/content/themes/roots/assets/css/main.min.css
I'm getting the wrong path for all assets in my themes (any theme I place into /content/themes
)
For example, in the source code, a stylesheet link points to:
http://localhost/content/themes/roots/assets/css/main.min.css
when it should be:
http://localhost/lab/Wordpress-Skeleton/content/themes/roots/assets/css/main.min.css
While debugging I found out that the global $wp_theme_directories returns an array with two paths, and both are correct:
.../htdocs/lab/WordPress-Skeleton/wp/wp-content/themes
.../htdocs/lab/WordPress-Skeleton/content/themes
but, the function get_theme_root_uri()
when called from the functions.php
of a theme located on the second path from the $wp_theme_directories
array, returns:
http://localhost/content/themes
The themes from the folder /wp/wp-content/themes
(the default ones that came with the WP submodule update) work fine.