X

Include from theme dir

Adding this PHP code to your wordpres theme will allow you to include a file located within your theme folder.



Code Snippet:


<?php
get_template_part( 'nav' ); // Navigation bar (nav.php)
?>

Comments  Leave a Reply

  1. Thanks jaredwilli, “updated now” must have missed that one. If you have any snippets it would be great if you could submit a few.

  2. That’s deprecated in 3.0. You’re supposed to use get_template_part( ‘filename’ )’ now

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!