Support » Developing with WordPress » Set up 404 page

  • Resolved Cezar Ayran


    Is it possible to load the 404 page whenever/reason you want?

    The thing is that I have a custom field and WP doesn’t use it by default to check if that taxonomy is supposed to be open or not… so I am checking with PHP that field and if it is not “Active” I am redirecting the user to the homepage but I would like to show the 404 page instead of redirect them… is there any function to do that?

    • This topic was modified 3 months, 3 weeks ago by Cezar Ayran.
Viewing 1 replies (of 1 total)
  • Thread Starter Cezar Ayran


    Found the solution:

    include( get_query_template( '404' ) );
    header('HTTP/1.0 404 Not Found');

    I just didn’t know the best way to ask Google what I wanted lol

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.