1

I would like to have my plugin detect the current "activated" theme. If my starter theme or the correct child theme is not loaded, then alert the administrator from wp-admin with an alert notification.

I can figure out the latter, but it's the former I have a question about...are their hooks or conditional tags already built into WordPress that allows me to do this easily, or do most professional wp coders have their own custom logic of doing this?

I'm ultimately building a plugin to assist & extend a specific starter theme.

I want the plugin to detect this for the existing theme, and if a theme in the future is activated.

Many thanks for the education!

1 Answer 1

3

You can use wp_get_theme to get current theme object.

$current_theme = wp_get_theme();

And it will return WP_Theme object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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