retlehs/roots — Issue #278: wp_enqueue_style and wp_enqueue_script problem non-root dir
Author: Sjeiti
Created: 2012-02-13 15:48:27+00:00
State: open

Hi,

I'm getting the wrong uri's when I try to use wp_enqueue_style and wp_enqueue_script in a child theme.

On 'wp_enqueue_scripts' I use 'get_stylesheet_directory_uri' to add css and js (in my child theme's functions.php).

Say my theme is located here: ./project/web/wp-content/themes/mytheme/
Then the uri that is returned is: ./project/web/project/web/wp-content/themes/mytheme/

I guess this is related to these two closed isseus:
- https://github.com/retlehs/roots/issues/148
- https://github.com/retlehs/roots/issues/170

And indeed: if I comment both ln 71 and 72 in roots-cleanup.php the problem goes away (those lines are: add_filter('theme_root_uri', 'roots_root_relative_url'); and add_filter('stylesheet_directory_uri')).

But those lines must be there for a reason right?

grtz

Ron