WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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

share|improve this answer
lol there is a function for that. well i just was ready with echo dirname ( dirname( get_stylesheet_uri() ) ); ;/ – amy Apr 28 '12 at 21:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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