Get File Path to WordPress Theme
![]() |
Saturday, November 7th, 2009 (No comments yet) |
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:
1 2 3 4 | $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.



