1 Nov 2008 01:09
Re: template_directory broken when using child themes
You can use the following functions to get directory or uri information. Template functions give you the directory of the parent theme, while stylesheet functions will give you the child themes directory. Functions that end with uri give you the uri to the directory, without a trailing slash the others return the full directory path to the directory, also without the trailing slash. These also do not echo the results so they need to be echoed or stored in a variable or whatever. I don't know if there are equivalent functions that echo the results, but I have checked these on 2.7 from cvs. You can look in the source code of wp -includes/theme.php to see these and some other usefull functions... get_stylesheet_directory_uri() get_stylesheet_directory() get_template_directory() get_template_directory_uri() Hope this helps, and have fun :) On Fri, Oct 31, 2008 at 10:20 AM, Ben Huson <ben@...> wrote: > Just did a quick test in a child theme in 2.7: > > - bloginfo('template_directory') points to the dependant theme directory > - bloginfo('stylesheet_directory') points to the child theme directory > > The stylesheet_directory is supposed to be depreciated from version > 2.3.1 but child themes would seem to be a case in point where you > might want to reference either the child theme directory or the > dependant theme directory. >(Continue reading)
RSS Feed