Archived topic
Flexslider scripts
2 replies · Started by Jean Paiva on February 26, 2015
Hey Tom, first of all congratulations on 150k downloads!
I'm need to call the flexslider script in my child theme. So far I've enqueued the script, but when loaded is heading to GP parent folder. Here's my code:
function acmmb_flexslider_scripts(){
//you enqueue the script
wp_enqueue_script( 'acmmb_flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'), GENERATE_VERSION, true );
}
add_action( 'wp_enqueue_scripts', 'acmmb_flexslider_scripts' );
How can I load the file in my child theme jf folder? Do I need to register first?
I made it! I've changed
get_template_directory_uri() for get_stylesheet_directory_uri()
Codex:
http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri
Thanks! Can't believe we're at 150k already :)
That's perfect - glad you found the solution!
get_template_directory_uri() returns the parent theme folder URL, where get_stylesheet_directory_uri() returns the folder of the stylesheet (the child theme, if activated).