Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development Building Page Templates in WordPress Building Page Templates in WordPress Quiz

Robert Bepko
Robert Bepko
2,837 Points

WordPress theme development & closing html container tags

Hi,

With WordPress theme development, should I always close container tags in the same file when building a page template php file? Or can closing tags "continue" in another php file if there's a need?

Thanks, Robert B.

2 Answers

Joel Bardsley
Joel Bardsley
31,247 Points

It's fine to close tags in a separate template, just make sure there isn't a possibility that you'd ever load one template and not the other. For previous projects, I've opened a container tag in header.php and closed it in footer.php. I don't see why you couldn't use two different template files instead, if that's what you had in mind.

Robert Bepko
Robert Bepko
2,837 Points

Exactly what I was thinking also (from beginner theme dev. perspective). Makes sense now. I remember going fast and furious in a BS->WP youtube tutorial where I recalled such separation occurred.

Thanks for quick response. -Robert