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 trialAndrew Pfund
6,965 Pointsstore navigation in get template part file?
Is it considered best practice to store all the navigation writeup in a 'get template part' file so the header is cleaner?
and then just place it in the header file with ...get_template_part( content, navigation )...
Or does doing that on every page a few times slow down the page load time slightly?
3 Answers
Anthony Moore
2,282 PointsYou should be using "wp_nav_menu()" to display your navigation. That would be the best practice.
Andrew Pfund
6,965 PointsI don't think you understood the question, wp_nav_menu() and any associated code with the nav would be placed in a template file, so that the header file is less cluttered, does that slow down the page at all?
Anthony Moore
2,282 PointsNo, that should not have any affect really on page speed.