[wp-trac] [WordPress Trac] #15078: Custom Loops in Twenty Ten

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 9 13:38:19 UTC 2010

#15078: Custom Loops in Twenty Ten
 Reporter:  koopersmith             |        Owner:        
     Type:  defect (bug)            |       Status:  closed
 Priority:  normal                  |    Milestone:  3.1   
Component:  Themes                  |      Version:  3.0.1 
 Severity:  normal                  |   Resolution:  fixed 
 Keywords:  has-patch dev-reviewed  |  

Comment(by demetris):


 As far as I understand, clashing is not an issue here.

 We are only talking about a tiny namespace —a few files confined within
 the boundaries of one theme’s directory— which is controlled absolutely by
 the author of the theme.  We are not talking about compatible name schemes
 across themes, or between themes and plugins, etc. etc.

 Or am I missing something?


 I think you are overlooking my main concern:

 (a) Twenty Ten is a theme that serves as a model .

 (b) {{{get_template_part}}} is a function that we like and promote because
 of its advantages over plain includes:  First, awaraness of child theme
 files.  Second granular control (thanks to its second argument).

 If (a) and (b) are true, why do we want to use {{{get_template_part}}} in
 Twenty Ten in a way that cancels or does not show off its second

 About {{{is_page_template}}}, here is what I think.
 {{{get_template_part}}} can be implemented in ways that make customization
 VERY easy.  Say, a user of your theme wants to have a completely static
 main menu.  Sure, you reply to them:  Make a child theme, make a
 ''nav.php'' file in it, and put this in the file:

 <div id="menu">
     <ul class="some classes">
         <li>Your first menu item</li>
         <li>Your second menu item</li>

 Then another user wants the same but only for Pages.  Very easy again.
 They do the same as the first user, only name the file ''nav-page.php''.

 Thanks to {{{get_template_part}}} all this is possible without even a
 single line of PHP code.

 Why not offer such simplicity and plain friendliness when we can?

Ticket URL: <http://core.trac.wordpress.org/ticket/15078#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list