• Resolved David Gard

    (@duck_boy)


    Hey all,

    I’m trying to amend my ‘header.php’ file so that the correct file path is written, regardless of whether I am using the parent or the child theme.

    I have changed bloginfo('template_directory') to echo get_template_directory_uri() as advised in this Function Reference/get bloginfo, but the path to the parent theme is always written.

    Any body know what I should be using?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The get_template_directory_uri() function will always return the directory of the templaet, which, in a Child Theme, per the “Template:” header tag in style.css, is the Parent Theme.

    If you need to reference the Child Theme directory URI, you should instead use the get_stylesheet_directory_uri() function.

    Thread Starter David Gard

    (@duck_boy)

    Ah, good stuff. Thanks for that.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Child theme returning partent themes file pate’ is closed to new replies.