Home Forums WoodMart support forum add_action( 'init', 'my_function_name' ) – Missing header and footer. Reply To: add_action( 'init', 'my_function_name' ) – Missing header and footer.

#225543

Master
Participant

The website is live but under maintenance mode and all the code that has to be uploaded is on localhost still.

Please paste this code to your child functions.php file and go to wp-admin, it will only take you a minute to see the problem.

`/**
* Xthemos test code.
*/
if ( ! function_exists( ‘xthemos_test_code’ ) ) {
add_action( ‘init’, ‘xthemos_test_code’, 1 );

function xthemos_test_code() {
if ( is_admin() ) {
global $wp_query;
$wp_query->set_404();
status_header( 404 );
nocache_headers();
get_template_part( 404 );
exit( ‘<div style=”color:red;font-weight:bold”>THIS CODE DISPLAYS THE 404 TEMPLATE BUT MISSING THE HEADER AND FOOTER! VIEW SOURCE CODE.</div>’ );
}
}
}