0

我只是想分享我在 Drupal 5.2 中获取当前主题名称的步骤。我从 theme.inc 中的 theme_get_function() 中获取了一段代码。

global $theme, $theme_engine;

// Because theme() is called a lot, calling init_theme() only to have it
// smartly return is a noticeable performance hit. Don't do it.
if (!isset($theme)) {
    init_theme();
}
var_dump($theme);

也许有人会像我一样需要这个提示。

谢谢!!

4

0 回答 0