single-{$post_type}-{slug}.php for custom post types

A) The Base in Core As you can see in the Codex Template Hierarchy explanation, single-{$post_type}.php is already supported. B) Extending the core Hierarchy Now there’re gladly some filters and hooks inside /wp-includes/template-loader.php. do_action(‘template_redirect’); apply_filters( ‘template_include’, $template ) AND: a specific filter inside get_query_template( $type, … ) named: “$type}_template” B.1) How it works Inside the … Read more

How to create custom 401, 403 and 500 error pages?

Error pages are served up via .HTACCESS, if you are using Apache you would use the ErrorDocument directive and add the status and URL to it. So it would look like this in your .htaccess file: ErrorDocument 401 http://yourwebsite.com/error-401 ErrorDocument 403 http://yourwebsite.com/error-403 ErrorDocument 500 http://yourwebsite.com/error-500 You could use the following function below. This will dynamically … Read more