您可以截取WordPress将用于template_include 滤器像这样:
add_filter (\'template_include\',\'wpse303537_plugin_template\', 10,1);
function wpse303537_plugin_template ($template) {
if (is_front_page)
$template = plugin_dir_path( __FILE__ ) . \'/my-template.php\';
return $template;
}
或者,您可以在主题中为登录页包含一个几乎为空的模板,并通过
get_header.