enqueue script and css file in child-theme or main plugin file in worpress FOR Child theme function theme_js() { wp_enqueue_script( 'theme_js', get_stylesheet_directory_uri() . '/js/custom.js', array( 'jquery' )); } add_action('wp_enqueue_scripts', 'theme_js'); FOR main plugin file function ecom_scripts(){ wp_enqueue_script("jquery"); wp_enqueue_script( 'foundation-script', plugins_url('/slider/foundation.min.js', __FILE__)); wp_enqueue_script( 'slick-script', plugins_url('/slider/slick.min.js', __FILE__)); // wp_enqueue_style( 'foundation-style', plugins_url('/slider/foundation.css', __FILE__)); wp_enqueue_style( 'slick-style', plugins_url('/slider/slick.css', __FILE__)); wp_enqueue_script( 'ecom-script', plugins_url('/js/custom.js', __FILE__)); wp_localize_script( 'ecom-script', 'myajax', array( ...