[theme-reviewers] get_template_part vs locate_template

Towfiq I. tislam100 at gmail.com
Fri Apr 22 17:35:30 UTC 2011


On Sat, Apr 23, 2011 at 10:58 PM, Justin Tadlock
<justin at justintadlock.com>wrote:

>  I wrote an extensive post that covers this:
>
> http://justintadlock.com/archives/2010/11/17/how-to-load-files-within-wordpress-themes
>
> Your code would actually look like this (no slash in front of "lib"):
>
> <?php locate_template( array( 'lib/my_codes.php' ), true ); ?>
>
>
>
Thanks! Didn't know about the locate_template hook. But the usage of the
this hook is not clear in the documentation
http://codex.wordpress.org/Function_Reference/locate_template

It would be great if there were some examples of how to load sub-directory
files with this hook in this page
http://codex.wordpress.org/Function_Reference/locate_template

Some may not know it can be done with this hook by reading this reference
page.

Thanks

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


More information about the theme-reviewers mailing list