Body tag in header AND template/footer?

So I'm pretty new at Wordpress development, and I'm a little confused by one thing. After going through and finishing my navigation in my header.php file, I went over to my template for the home page I'm working on. My question is: since the "body" tag is the only place you can write that actually shows up in the browser ("header" tags are for meta data etc), can I have more than one body tag? I read a little into html 5, and it seems there are more tags than just "body" now, but what's the best way to do that? I already have my menus wrapped in and what do I do with the footer, etc? Thanks for any help.

Topic wp-blog-header.php Wordpress

Category Web


Structure your theme so you start the <body> in the header and you close the </body> in the footer (same thing for the <html> tag):

header.php

<html>
...header content
<body>   <!--- body is started in the header, used on every page -->

index.php, page.php, single.php, home.php - etc

...content

footer.php

...footer content
</body>   <!-- body is closed in the footer, also used on every page -->
</html>

This may help you regarding having two body tags. is_front_page() will help you to echo body tag conditionally... either in header/footer.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.