[wp-hackers] bloginfo('template_directory'); returns parent theme's directory, is this intended?

Philip M. Hofer (Frumph) philip at frumph.net
Mon Jan 10 18:20:16 UTC 2011


don't use it
use this:

get_template_directory(_uri)()  i.e. get_template_directory() and 
get_template_directory_uri()  -- main parent theme only

get_stylesheet_directory(_uri)() i.e. get_stylesheet_directory() and 
get_stylesheet_directory_uri() -- child theme (*if*) child theme exists, 
else go to parent theme.



----- Original Message ----- 
From: "Ryan Bilesky" <rbilesky at gmail.com>
To: <wp-hackers at lists.automattic.com>
Sent: Monday, January 10, 2011 10:17 AM
Subject: [wp-hackers] bloginfo('template_directory'); returns parent theme's 
directory, is this intended?


>I am wanting to make several tweaks to a theme for my use, and I've chose 
>to
> do so by making a child theme to be upgrade safe.  However I noticed that 
> I
> changed some colors around on my child themes css but I was not seeing the
> change.  So I viewed source of my site and saw that it was using the 
> parent
> theme's css file.  In the header.php this was the code:
>
> <link rel="stylesheet" type="text/css" href="<?php
> bloginfo('template_directory'); ?>/style.css" />
> I fixed this by adding a modified version of header.php in my child themes
> directory that has the css url hard coded.  So my question is this, is
> bloginfo('template_directory'); supposed to return the parent theme or 
> child
> theme directory when called?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 




More information about the wp-hackers mailing list