• I’m reporting a potential bug. Minor, but is it odd enough that it could point toward something more important? Smarter people than me can answer that question.

    On localhost, multisite, with a child theme…

    get_stylesheet_directory() returns a buggy path. Example:

    https://localhost/[multisite_root]/[site]/Users/[username]/[local_root]/[multisite_root]/wp-content/themes/[child_theme]

    get_bloginfo( ‘stylesheet_directory’ ) in this instance works properly.

    example in use:

    wp_enqueue_script(
    	'tableplugin',
        get_stylesheet_directory() . '/js/stupidtable.min.js', // doesn't work
        // get_bloginfo( 'stylesheet_directory' ) . '/js/stupidtable.min.js', // works
    	array('jquery')
    );

  • The topic ‘get_stylesheet_directory bug on localhost’ is closed to new replies.