get_header() doesn’t work, but get_footer() does
-
I’m trying to create a WordPress theme but I’m facing a problem, the
get_header() function doesn't inject the
header.phpcode, while
get_footer()` works fine.
this is my code:
header.php
<html> <head> <meta charset='utf-8'> <meta http-equiv='X-UA-Compatible' content='IE=edge'> <meta name='viewport' content='width=device-width, initial-scale=1'> <?php wp_head(); ?> </head> <body> <header> header </header>
front-page.php
<?php get_header(); ?> front page content <?php get_footer(); ?>
footer.php
<?php wp_footer(); ?> <footer> footer </footer> </body> </html>
The odd part is that when creating a new
header-a.php
file , with the exact same code asheader.php
I can load it usingget_header('a')
and it works fine;Any idea why it happens and how to fix it?
Thanks.
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘get_header() doesn’t work, but get_footer() does’ is closed to new replies.