1

I want to get the theme root URL with PHP. What would be the best way to do that?

There is a function called get_theme_root() which gives me the path but not the URL.

Maybe just get the current themes or parent themes URL and cut the theme directory off? How do I do that?

1 Answer 1

2

I think you just want get_theme_root_uri(). Note that it doesn't contain the trailing slash.

1
  • lol there is a function for that. well i just was ready with echo dirname ( dirname( get_stylesheet_uri() ) ); ;/
    – amy
    Commented Apr 28, 2012 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.