How to query for parent theme(s)? Drupal lets you sub-theme a theme, basically like inheritance.  How can I print out a list of all themes that a drupal site is 'using'.  For example: actual theme -> parent theme 1 -> base theme
This is how Display Suite does it:

// Get layouts defined in the default theme and base theme (if applicable).
$theme = variable_get('theme_default');
$themes = list_themes();

$base_theme = array();
$ancestor = $theme;
while ($ancestor &amp;&amp; isset($themes[$ancestor]-&gt;base_theme)) {
  $ancestor = $themes[$ancestor]-&gt;base_theme;
  $base_theme[] = $themes[$ancestor];
}