When I remove get_header() from 404 page, my css doesnt work.
<?php
/**
* The template for displaying 404 pages (Not Found)
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
?>
<div class="page-content">
<h1 class="page-title"><?php _e( 'Not Found', 'twentyfourteen' ); ?></h1>
<p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyfourteen' ); ?></p>
</div>
css
.page-content {
max-width: 300px;
margin: 0 auto;
text-align: center;
}
.page-title {
color: red;
}
get_header()
? Your CSS file is linked in this header, so it makes sense that it is no longer working when you remove this piece of code.html
,head
,body
directly in to the 404 page template. Your "header" that is associated withget_header()
includes way more than just your navigation. Check yourheader.php
file to see what is included.