3

OK, this may be a dumb question. Is it possible, using PHP, to detect which theme has been set for use by Wordpress ? If so, how's it done ?

Thanks.

  • The bigger question here is why you would need this information. I have the suspicion that your need to get the current theme may be due to some other, possibly non-standard, approach that could probably be done a lot easier the "WordPress way". Care to elaborate? – Tom Auger Aug 30 '11 at 19:20
6

If you only need the current theme name, you can use get_current_theme().

|improve this answer|||||
3

This snippet will get the current theme info for you.

$theme_data = wp_get_theme();
echo $theme_data->Name;

See wp_get_theme for more information.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.