getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
634 stars 95 forks source link

What is the most appropriate way to show a 404 error page (from theme)? #146

Open kmbt opened 7 years ago

kmbt commented 7 years ago

Hi, I would like to ask what is the most appropriate way to show a 404 error page (from theme)? One way I found is doing this:

function return_404() {
    status_header(404);
    nocache_headers();
    include( get_404_template() );
    exit;
}

as proposed here. I wonder if there is a more herbert-way to do it.