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

Ryan Bilesky rbilesky at gmail.com
Mon Jan 10 18:26:21 UTC 2011


ok just wanted to check.  I don't really have any control over how the
parent themes author did this, sort of modfying it in my own
header.php file.  I just wanted to make sure this wasn't a bug.

On Mon, Jan 10, 2011 at 10:22 AM, Peter Westwood
<peter.westwood at ftwr.co.uk>wrote:

>
> On 10 Jan 2011, at 13:17, Ryan Bilesky wrote:
>
> > 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?
> >
>
> This is working correctly.
>
> The "Template" is the Parent Theme
> The "Stylesheet" is the Child Theme
>
> So for the child theme you want 'stylesheet_directory'
>
> Ideally though you wouldn't be using bloginfo at all and rather:
>
> get_stylesheet_directory_uri / get_template_directory_uri
>
> Cheers
> --
> Peter Westwood
> http://blog.ftwr.co.uk | http://westi.wordpress.com
> C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5
>
> _______________________________________________
> 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