Do I really need to use header.php and footer.php?
-
Im kinda new to WordPress and been using it mostly to learn about theme creation, my so called “blog” mostly has lorem ipsum in it. AS I said im just trying stuff here…
My WordPress book and the Codex both say that the most basic theme included a least the index.php header.php footer.php and sidebar.php. And I did my first really basic theme following this rule.
But I have discover that I can replace these by other with the include command or even not have them at all (sidebar in a page).
So I asked myself if I could create a template with only one php document. I pasted the my header and footer code directly in a template creating a single file template, and evrything seem to work fine, WordPress does not seem to mind at all.
I can see the clear advantage of using a header.php and footer.php file when the same header and footer is the same across many template. But If I have a template with a unique header it seem more logical to put everything in one template file rather then three or four files.
Is there something wrong with doing a template this way?
- The topic ‘Do I really need to use header.php and footer.php?’ is closed to new replies.