Skip to:
Content
Pages
Categories
Search
Top
Bottom

”template_url” broken when using a child theme?


  • ben_allison
    Member

    @ben_allison

    I’m developing a child theme, and am trying to use to pull images for use in my theme… but the url it spits out is that of the main theme.

    Is there a way to programatically call the child theme directory when using a child theme?

Viewing 2 replies - 1 through 2 (of 2 total)

  • ben_allison
    Member

    @ben_allison

    Anyone?

    TEMPLATEPATH is the same.


    @mercime
    Participant

    @mercime

    `TEMPLATEPATH` and `STYLESHEETPATH` (for child themes) have been deprecated in favor of `template_directory_uri` (for files you want for parent theme) and `stylesheet_directory_uri `(for files you need in your child theme folder) respectively.

    e.g. you added localization for your child theme, so one of the lines you’ll be adding to your child theme’s functions.php in the past would have been
    `load_theme_textdomain( ‘mytextdomain’, STYLESHEETPATH . ‘/languages’ );`

    Now should be
    `load_theme_textdomain( ‘mytextdomain’, get_stylesheet_directory() . ‘/languages’ );`

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘”template_url” broken when using a child theme?’ is closed to new replies.
Skip to toolbar