How do I get the path of the current drupal theme?

this should work (doc):

global $theme;
$path = drupal_get_path('theme', $theme);

// there's also a $theme_path global

global $theme_path;

Use the path_to_theme function.


In Drupal 8, if you need to get the active theme path when you have the admin theme active you can fetch the default theme path:

$themeHandler = \Drupal::service('theme_handler');
$themePath = $themeHandler->getTheme($themeHandler->getDefault())->getPath();

In D6 path_to_theme() may not behave in a way you expect depending on how you are using it. If you are using it outside any theme preprocess functions, then it will probably give you what you want, but if it is being called within the context of a module's theming/preprocess hook function... it will be pointing to the module path that declared the theme.

Ex. If i have a theme "my_theme" and my module "my_module" which is overriding the forum themes using the preprocess hooks, calling path_to_theme() within my module: e.g. my_module_preprocess_forums()... will return "forums", and not "my_theme" as one might expect.

Very fruity if you ask me.