您必须实现自己的钩子template_redirect
措施:
add_action( \'template_redirect\', \'wpse8170_template_redirect\', 1 );
function wpse8170_template_redirect() {
global $wp_query;
// check if it is not a page or if it is front page, then exit from the hook
if ( !$wp_query->is_page() || $wp_query->is_front_page() ) {
return;
}
// check queried object, if it is not a specific page, then exit from the hook
$page = get_queried_object();
if ( $page->ID != 777 ) { // your page ID
return;
}
// render header
get_header();
// ... render your content here ....
// render footer
get_footer();
exit;
}