Hi,
is there a way to trigger the 404 error, so the is_404() will return true?
Hi,
is there a way to trigger the 404 error, so the is_404() will return true?
Hello,
Can't this just be triggered by visiting a random URL on your website which doesn't exist?
Dave.
No, I don't want to trigger it myself, I want to trigger it from the theme or plugin files. wp_redirect() to inexisting random URL is also not an option.
EDIT:
ok, I found it in the source code.
eg.:
global $wp_query;
$wp_query->set_404();
This topic has been closed to new replies.