XF 2.2 How to get current theme name or id

From where?

The effective style isn't determined until pre-rendering (a bit late in the request lifecycle), since it can be set explicitly on reply objects. Specific nodes can force a particular style, for example.

After pre-rendering, the style object is available in PHP via the templater object:
PHP:
$style = \XF::app()->templater()->getStyle();
$title = $style['title'];

And in templates, it is available in the global $xf variable:
HTML:
{{ $xf.style.title }}
 
I mean from Styles page, how can I get the name of the active one? admin.php?styles/
I got null using the code you suggested.
 
The default style...?

PHP:
// id
$id = \XF::options->defaultStyleId;

// title
$style = \XF::app()->style();
$title = $style['title'];
 
Back
Top Bottom