I tried hard finding another question that may answer my query but failed, so if you point any duplicates that would help.
Here is my situation
I have a parent theme and I am developing a child theme for some functionality that I would like to develop and in the child theme I have called wp_enqueue_script
multiple times. The parent theme has its own list of scripts and styles.
The issue is once I have a child theme get_stylesheet_directory points to the child theme and I am trying to find if there is a way to avoid this without modifying the parent theme at all.
Here are two methods I tried
//first method where I tried enqueue
add_action( 'wp_enqueue_scripts', 'custom_child_theme_styles' );
//ensure that the child theme scripts are called after the old theme
add_action( 'after_setup_theme', 'custom_child_theme_scripts' );
and this is what the parent theme does
add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' );
And when the parent theme calls get_stylesheet_directory() it points to the child theme folder and hence javascripts from the parent theme dont load at all.