Skip to content

Instantly share code, notes, and snippets.

@matthiaspabst
Created February 14, 2012 17:08
Show Gist options
  • Save matthiaspabst/1828183 to your computer and use it in GitHub Desktop.
Save matthiaspabst/1828183 to your computer and use it in GitHub Desktop.
404-Bild in WordPress anzeigen
<?php
if ( preg_match( '~\.(jpe?g|png|gif|svg|bmp)(\?.*)?$~i', $_SERVER['REQUEST_URI'] ) )
{
header( 'Content-Type: image/png' );
locate_template( 'images/404.png', TRUE, TRUE );
exit;
}
?>
@matthiaspabst
Copy link
Author

In 404.php vor get_header() einfügen.
Via http://wpengineer.com/2377/implement-404-image-in-your-theme/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment