Skip to content

Instantly share code, notes, and snippets.

@zorem
Last active May 13, 2020 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zorem/a3392b2c1be707e8e9e42d8a32e956ce to your computer and use it in GitHub Desktop.
Save zorem/a3392b2c1be707e8e9e42d8a32e956ce to your computer and use it in GitHub Desktop.
How To Change Redirect The 404 Error Page
/**
* redirect 404 error page.
*/
function redirect_404_to_otherpage($url){
return $url = get_permalink('page id');
}
add_filter( 'cbr_redirect_page_dir', 'redirect_404_to_otherpage', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment