You could always set WP_USE_THEMES
to false
, and handle all the template/display logic on your own. (But, that requires access to the users wp-config or index to set the constant, which is out of scope for a plugin, though you could make it an installation requirement).
Taking a look at template-loader.php you could have an starting point to see the kind of logic you would need to reimplement.
Or otherwise you could let your users choose a theme as a fallback for all the situations not covered by your plugin, and make copious use of template_include
to choose your plugin provieded templates on certain scenarios circumstances.
Directly from the codex:
add_filter( 'template_include', 'portfolio_page_template', 99 );
function portfolio_page_template( $template ) {
if ( is_page( 'portfolio' ) ) {
$new_template = locate_template( array( 'portfolio-page-template.php' ) );
if ( '' != $new_template ) {
return $new_template ;
}
}
return $template;
}
At first blush I’d say that the second approach it’s a bit sounder, but even then I would put more work into decoupling theme from plugin to give yourself and your users more flexibility in the future.