How to do custom 404 page

404 if not found plugin is shows a default “404 not found” error page.
But what if i need to my /404.php page shown?
it’s set in nginx config and work well with /*any page that dont exist*.php

Replace the $notfound = .... part with include path/to/404.php

1 Like

So should the function look like this?

function custom_404() {
    $notfound = include /404.php;

it doesn’t work for me

Yeah, well, I assumed you had basic PHP knowledge. You should have something like:

function ozh_404_if_not_found() {
    include("/full/path/to/404.php"); // quotes, and full path

Heh, now it’s work, but without first slash in path. Thanks (´・ᴗ・ ` )