Last active
November 11, 2018 08:56
-
-
Save davidmaneuver/7a3700ef9c647cf7139d5eba668552b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Serve 404 header whenever rendering the notound.twig template. | |
**/ | |
add_filter('timber_render_file', function($template) { | |
if (strpos($template, 'notfound.twig')) { | |
status_header(404); | |
} | |
return $template; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment