Get File Path to WordPress Theme
![]() |
Saturday, November 7th, 2009 (4 comments) |
For some reason, the WordPress team removed the ability to simply get the file path to your theme folder. Here’s how to get it quickly:
$url = get_bloginfo("template_url");
$temp = explode("wp-content/themes/",$url);
$active_theme_name = $temp[1]; // The second value will be the theme name
$theme_path =get_theme_root()."/".$active_theme_name;
When done, $theme_path will be the file path from the root of your current system to your active theme’s folder.






Cool, you can also use:
get_theme_root() . ‘/’ . get_template()
Thanks for the tip!
I was looking for it! Thank
Thank you SO MUCH for posting this – I knew this existed, but everyone’s using roundabout ways to extract it from the bloginfo() returns instead, it looks like.