[wp-trac] [WordPress Trac] #15086: get_template_part() should let you specify a directory

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 18 22:46:27 UTC 2012


#15086: get_template_part() should let you specify a directory
-------------------------------------------------+-------------------------
 Reporter:  aaroncampbell                        |       Owner:  westi
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  Future
Component:  Themes                               |  Release
 Severity:  normal                               |     Version:  3.0
 Keywords:  has-patch westi-likes needs-unit-    |  Resolution:
  tests 2nd-opinion                              |
-------------------------------------------------+-------------------------

Comment (by scribu):

 What nacin said. This will always work the same:

 {{{
 get_template_part( 'subdir/loop', get_post_format() );
 }}}

 {{{
 /theme/subdir/loop-standard.php
 /theme/subdir/loop.php
 }}}

 And if we add the dir flag, you'd get a sub-sub directory:

 {{{
 get_template_part( 'subdir/loop', get_post_format(), true );
 }}}

 {{{
 /theme/subdir/loop/standard.php
 /theme/subdir/loop.php
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15086#comment:52>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list