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 From Bootstrap to WordPress Setup a Bootstrap Theme Creating Bootstrap Navigation in WordPress

Andrew Pfund
Andrew Pfund
6,965 Points

store 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
Anthony Moore
2,282 Points

You should be using "wp_nav_menu()" to display your navigation. That would be the best practice.

http://codex.wordpress.org/Function_Reference/wp_nav_menu

Andrew Pfund
Andrew Pfund
6,965 Points

I 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
Anthony Moore
2,282 Points

No, that should not have any affect really on page speed.