[wp-testers] template_directory broken when using child themes

Ben Huson ben at thewhiteroom.net
Fri Oct 31 14:20:59 GMT 2008


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.

See http://wordpress.org/support/topic/188569

If the template_directory is set to point to the child theme, how can
you refer to the parent theme?

Maybe stylesheet_directory should not have been depreciated?

- Ben


2008/10/31 Cristi Antohe <sareiodata at gmail.com>:
> Hi,
>
> This is a problem in the 2.6 branch as well if I'm not mistaking. It
> would be nice to get it fixed for 2.7 especially with the extra
> functionality in 2.7 for Child themes.
>
> Cristi Antohe
> http://www.cozmoslabs.com
>
> On Fri, Oct 31, 2008 at 3:47 PM, Thord Daniel Hedengren
> <tdh at tdhedengren.com> wrote:
>> Hi,
>> Stumbled onto this one just now. When using child themes (addon themes or
>> whatever you want to call them), the bloginfo('template_directory') will
>> point to the template theme, not the child theme, even if you use it within
>> the chile theme's template files.
>>
>> A child theme is a theme that relies on another theme for most things. The
>> relationship is established in the child theme's style.css.
>>
>> Is there a new template_directory solution to reach the child theme's
>> directory, or do we need to hack around this somehow?
>>
>> Thanks,
>> TDH / tdhedengren.com
>>
>> --
>> MVH/Regards,
>> Thord Daniel Hedengren
>>
>> NETWORK / www.pakten.se / ME / www.tdhedengren.com + www.tdh.se /
>> CORPORATE / www.cylinderlabs.com / Cylinder Labs AB, Sommargatan 24, 272 37
>> Simrishamn, Sweden
>> _______________________________________________
>> wp-testers mailing list
>> wp-testers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-testers
>>
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>


More information about the wp-testers mailing list