From 4fe10c84d7b9a5973128d0da08d3b8337259b734 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Sun, 11 Jan 2026 21:09:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=8A=A0=E8=BD=BD=E5=92=8C=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=97=A0=E6=B3=95=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - header.php: 修改 wp_enqueue_script 在头部加载 jQuery 和插件 - sidebar.php: 使用轮询机制等待 jQuery 和 headIndex 加载完成后再初始化目录 --- header.php | 6 +++--- sidebar.php | 32 ++++++++------------------------ 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/header.php b/header.php index 9ae3c1b..89d8bb4 100644 --- a/header.php +++ b/header.php @@ -271,7 +271,7 @@ wp_enqueue_style("style", $GLOBALS['assets_path'] . "/style.css", null, $GLOBALS['theme_version']); // 集成外部资源备用机制 - wp_enqueue_script("resource_loader", $GLOBALS['assets_path'] . "/assets/vendor/external/resource-loader.js", null, $GLOBALS['theme_version']); + wp_enqueue_script("resource_loader", $GLOBALS['assets_path'] . "/assets/vendor/external/resource-loader.js", null, $GLOBALS['theme_version'], false); if (get_option('argon_disable_googlefont') != 'true') { // 使用备用机制加载Google Fonts @@ -284,8 +284,8 @@ '; } - // 加载 argon_js_merged(包含 jQuery 和其他库) - wp_enqueue_script("argon_js_merged", $GLOBALS['assets_path'] . "/assets/argon_js_merged.js", null, $GLOBALS['theme_version']); + // 加载 argon_js_merged(包含 jQuery 和其他库)- 在头部加载以确保后续脚本可用 + wp_enqueue_script("argon_js_merged", $GLOBALS['assets_path'] . "/assets/argon_js_merged.js", null, $GLOBALS['theme_version'], false); ?> diff --git a/sidebar.php b/sidebar.php index ea3df1f..1332874 100644 --- a/sidebar.php +++ b/sidebar.php @@ -431,15 +431,12 @@ $author_desc = get_option('argon_sidebar_author_description');