WordPress tutorials: Include from theme dir

Wpsnipp – One thing I’ve seen in some themes is the use of the get_template_part() function (described below) to load a functions file like this. Adding this PHP code to your wordpres theme will allow you to include a file located within your theme folder.Using the shortcodes.php example, the code would look like:

 

 

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

Be Sociable, Share!

Leave a comment