[theme-reviewers] get_template_part vs locate_template

Towfiq I. tislam100 at gmail.com
Fri Apr 22 17:01:39 UTC 2011


So if we want to load a file from a sub-directory(for example
"mytheme/lib/my_codes.php") we can use this:

<?php locate_template( array( '/lib/my_codes.php' ), 1); ?>

IF it  works and if it is advised, then I gotta say it will be a huge
relief. I always wondered how to load files that are located in
sub-directory of the theme folder. Didn't know it can be done with
get_template_part() hook since it is not mentioned in
http://codex.wordpress.org/Function_Reference/get_template_part

Thanks.

-- 
Towfiq I.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110422/8db5fb3b/attachment-0001.htm>


More information about the theme-reviewers mailing list