[wp-trac] Re: [WordPress Trac] #7492: Template tag: wp_include_file

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 12 08:38:26 GMT 2008


#7492: Template tag: wp_include_file
-------------------------+--------------------------------------------------
 Reporter:  KKWangen     |        Owner:  westi   
     Type:  enhancement  |       Status:  assigned
 Priority:  normal       |    Milestone:  2.9     
Component:  Template     |      Version:          
 Severity:  normal       |   Resolution:          
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by KKWangen):

 I do have a similar code in my themes, but I thought it might be better to
 have the functionality in the core of WordPress so everyone can benefit
 from it.

 There are other possible usage of this code;
 because the code checks if the file you want to include is current, a
 theme author may add ''support'' for a navigation bar on top of their
 theme, by adding the code to their header.php:


 {{{
 <?php wp_include_file('navbar'); ?>
 }}}

 So if a user of the theme wants a navigation bar, s/he only have to create
 the file navbar.php with the code s/he want and add it to the theme. And
 if they don't want it anymore, they can just delete the file without the
 theme breaking.

 - I know several themes uses filters for this, but by experience most
 theme users are not that happy with writing php functions to make a theme
 work for them.


 I do think WordPress needs some kind of function to deal with misc.
 template files, because when WP 2.7 comes along, theme authors will
 encourage theme users to make child themes if they want to customize the
 theme. And theme authors will tell that all template files can be
 overridden in the child theme.

 But an end user of a theme do not know which files that's WordPress
 standard template files and which is misc. template files created/ added
 by the theme author.

 So if someone tries to customize the WordPress default theme by creating a
 child theme of it, they will ask and wonder why searchform.php can't be
 overridden like all the other template files.

 But; if you think it's a bad idea to have this functionality/ template tag
 in WordPress core, and it rather should be something added to a theme's
 functions.php file, that's okay with me.

 I just think it would be easier for everyone, - and especially for theme
 authors who's not very familiar with writing own functions for their
 themes.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7492#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list