[theme-reviewers] Child themes discussion

Philip M. Hofer (Frumph) philip at frumph.net
Sat Jan 22 18:31:01 UTC 2011


if  (is_child_theme() && 
file_exists(get_stylesheet_directory().'/image/header.jpg')) $image = 
get_stylsheet_directory_uri().'/images/header.jpg';

can always do checks first ya


----- Original Message ----- 
From: "Otto" <otto at ottodestruct.com>
To: <theme-reviewers at lists.wordpress.org>
Sent: Saturday, January 22, 2011 10:26 AM
Subject: Re: [theme-reviewers] Child themes discussion


> On Sat, Jan 22, 2011 at 12:24 PM, Philip M. Hofer (Frumph)
> <philip at frumph.net> wrote:
>> if you do
>>
>> <img src="<?php echo get_stylesheet_directory_uri(); 
>> ?>/images/header.jpg"
>> alt="header image" />
>>
>> If a child theme exists, it will use the one from the chlid theme 
>> directory,
>> if child theme does not exist will grab from the parent theme
>
> But that won't work if you want a fallback position.
>
> Like say my parent theme has header.jpg, and I only want to link to
> the child's header.jpg if the child actually *has* a header.jpg. Won't
> work.
>
>
> On Sat, Jan 22, 2011 at 12:21 PM,  <michael at mfields.org> wrote:
>> I was never able to find a good solution in core, but put this function
>> together last year http://wordpress.pastebin.com/1fkvPTTj to allow parent
>> files to be overridden in child themes.
>
> Using the is_child_theme() function in 3.0 will let you know if you're
> running a child theme or not, allowing you to bypass some of that
> check if you're not. Bit faster.
>
> -Otto
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
> 




More information about the theme-reviewers mailing list