I'm developing a pseudo admin area for my client and they don't want the theme overlaid on it, rather have their admin area take up 100% of the page. Normally I would add if (!is_page($id)) and be done with it however this admin area is part of a plugin that will be used on multiple sites and I would rather not be adding that line of code to every site that is created with this plugin.

Essentially, is there a function akin to use_theme(false) that I can use as part of my plugins shortcode?


Is it possible to call define('WP_USE_THEMES', false); from a plugin file? I have tried adding it to the top of my short codes function but to no avail. This is leading me to believe that the template is called before the plugins meaning by the time you get to calling plugins it's too late?


I have had luck creating a page template using this plugin however it is still loading the page css. My template file is listed here on pastebin. The page still shows as if the theme is being called in it's entirety. I am fairly certain it's been called because the plugin is no longer outputting an incorrect plugin_dir_path which it was doing due to hierarchy fun.

1 Answer 1


Finally figured it out.

Using the plugin mentioned above (linked here for ease) and the basics of the answer to this question I was able to cobble together this code

It's a bit hamfisted, I'll admit that (mainly replacing the preg_match with strstr) but it got the job done.

I'm open to any improvements you all can think of so please feel free to comment improvements.

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.