When enqueueing scripts in a child theme directory, use get_stylesheet_directory_uri()
instead of get_template_directory_uri()
. In the case of a child theme, get_template_directory_uri()
will return the parent theme’s directory.
function enqueue_filterable(){
wp_register_script(
'filterable',
get_stylesheet_directory_uri() . '/js/filterable.js',
array( 'jquery' )
);
wp_enqueue_script( 'filterable' );
}
add_action( 'wp_enqueue_scripts', 'enqueue_filterable' );