dev-master
9999999-dev404 status helper functions for WordPress themes
MIT
The Requires
- php >=7.0.0
1.0.0
1.0.0.0404 status helper functions for WordPress themes
MIT
The Requires
- php >=7.0.0
404 status helper functions for WordPress themes
404 status helper function for WordPress themes., (*1)
You can install the package via Composer:, (*2)
composer require mindkomm/theme-lib-404
Name | Summary | Type | Returns/Description |
---|---|---|---|
force_404 | Forces 404 headers on a query. |
Forces 404 headers on a query., (*3)
Use this function in a WordPress template file., (*4)
When a template other than 404.php is loaded, the proper headers for a 404 status are not set properly. This function can be used to set proper headers even after a template file is loaded., (*5)
What you have to do after this request is to include the 404 template and exit after it., (*6)
PHP, (*7)
if ( 'publish' !== $post->post_status ) { force_404(); Timber::render( '404.twig', $context ); exit; }
This is a library that we use at MIND to develop WordPress themes. Youâre free to use it, but currently, we donât provide any support., (*8)
404 status helper functions for WordPress themes
MIT
404 status helper functions for WordPress themes
MIT