WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] child themes and get_stylesheet_directory (2 posts)

  1. Adam
    Member
    Posted 1 year ago #

    I am having an issue with loading some javascript in a child theme I am creating for one of my themes.

    Essentially I do:

    get_stylesheet_directory() . '/path/to/javascript.js'

    which is what your suppose to do, But , as per the documentation, I am getting:

    mysite.com/dev/home/path/to/wordpress/path/to/theme/path/to/js.js

    which is causing it to not find the required file. because home is at the root of the site.

    any ideas on what I can do to fix this?

  2. keesiemeijer
    moderator
    Posted 1 year ago #

    To retrieve the URI of the stylesheet directory use get_stylesheet_directory_uri()

Topic Closed

This topic has been closed to new replies.

About this Topic