I think you originally meant “TEMPLATEPATH” not TEMPLATE _URL …
Nope, TEMPLATEPATH gives the actual file path – like /nfs/www/httpdocs/ blah blah. Not the www.domain.com type url.
- Sold between 250 000 and 1 000 000 dollars
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 5-6 years
- Author has had an Item Featured
- Referred between 500 and 999 users
I think you originally meant “TEMPLATEPATH” not TEMPLATE _URL …Nope, TEMPLATEPATH gives the actual file path – like /nfs/www/httpdocs/ blah blah. Not the www.domain.com type url.
I know…but I thought it would work in this case. I just looked at wp_enqueue_script() in the codex, and you’re right! ... needs to be a web url.
Hi All, I’d like to comment on the use of the TEMPLATE _URL constant.
Adding the following to your theme’s functions.php file will resolve this:
define( 'TEMPLATE_URL', trailingslashit( get_stylesheet_directory_uri() ) );
Alternatively, replacing TEMPLATE _URL with
trailingslashit( get_stylesheet_directory_uri() ) in your PHP code will achieve the same effect.
I hope this helps, guys.
All the best, Matty.