0

I'm starting a brand new theme and my header.php's content is not being output to the browser, the browser is just plainly ignoring it.

Any ideas?

EDIT: I just wasn't calling it by get_header(), sorry!

2
  • Hi. What do you mean by Not working? Put a simple Hello in it and see if it appears in the console. – Jack Johansson Jul 29 '17 at 2:14
  • nop, that is what is not working :D – Marcos Di Paolo Jul 29 '17 at 2:14
3

Simply having a header.php in your theme's folder will not output your header to the browser. You have to call the header too.

To call the header.php file, you should use get_header(); at the top of almost every template (Almost!) such as page.php, single.php, archive.php and so on.

Do the same for footer.php to get the footer.

I can't quite recall the full list, but these are the main files:

archive.php
author.php
category.php
date.php
front-page.php
home.php
index.php
page.php
single.php
singular.php
search.php
tag.php
taxonomy.php

This also applies to child pages, and child theme's pages, such as page-abc.php.

Also, take a look at the WP Hierarchy schematic. This is greatly useful for those who want to start developing themes.

3
  • you got it man, i actually knew that but apparently i deleted it accidentally. Thanks a lot!!! – Marcos Di Paolo Jul 29 '17 at 2:23
  • You are most welcome. I've added a link too, you mind find it useful. – Jack Johansson Jul 29 '17 at 2:23
  • Thanks for the template hierarchy!!, so helpful!!, exactly what i needed!! – Marcos Di Paolo Jul 29 '17 at 3:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.