Add Script in WordPress functions.php

wp_enqueue_script('script', get_template_directory_uri().'/assets/js/script.js', array(), $theme_version, true);
wp_enqueue_script('bootstrap-bundle-min',get_template_directory_uri().'/assets/vendor/bootstrap/js/bootstrap.bundle.min.js',
array(), $theme_version, false);
wp_enqueue_script('swiper-bundle-min', get_template_directory_uri().'/assets/vendor/swiper/swiper-bundle.min.js', array(), $theme_version, false);
}
add_action('wp_enqueue_scripts', 'mytheme_register_scripts');
?>

Syntax:

wp_enqueue_script('script', get_template_directory_uri().'path of script.js', array(), $theme_version, true);
}
add_action('wp_enqueue_scripts', 'function-name');
?>

Leave a Reply

Your email address will not be published. Required fields are marked *