Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.