在此先感谢您提供的任何帮助。
我的wordpress上有一个wordpress Script n样式扩展,之前的开发人员添加了它。但是我注意到当我在“脚本n样式”中更新我的脚本时,这并没有改变任何东西。没有缓存,缓存,刷新任意次数,切换导航器不更新脚本保持不变。
看看:Script n Styles extension's script here
Script displayed on the page whatever I do in script n style extension
你有什么想法可以来自哪里?如果你愿意,我可以发送该网站的链接!它的afh.asso.fr(主页只使用那一段代码(它用于主页上的“mon afh”小红色按钮)
在此先感谢您的帮助,非常感谢! :)
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');
function theme_enqueue_styles() {
// Get the theme data
$the_theme = wp_get_theme();
// Add custom style here in custom.css
wp_enqueue_style('custom', get_stylesheet_directory_uri() . '/css/custom.css', array(), $the_theme->get('Version'));
wp_enqueue_script('jquery');
// add custom javascript here in custom.js
wp_enqueue_script('main', get_stylesheet_directory_uri() . '/js/custom.js', array(), $the_theme->get('Version'), true);
}
可以在这里找到更多信息: https://developer.wordpress.org/reference/functions/wp_enqueue_script/