In WordPress è possibile usare anche una pagina statica come template per l'errore 404.
La soluzione è la seguente (header.php
):
<?php
if( is_404() ) {
$page = file_get_contents( get_template_directory_uri() . '/template/404.html' );
echo $page;
exit();
} else {
// Template standard per header.php
}
?>