From 6754acdfaa94e11dc530e212fbcdb50b4d0047f8 Mon Sep 17 00:00:00 2001 From: liuzc Date: Tue, 19 Feb 2013 22:32:40 +0800 Subject: [PATCH] Only load js file on single and page,And put embed.js before --- duoshuo/WordPress.php | 57 +++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/duoshuo/WordPress.php b/duoshuo/WordPress.php index d63ed25..1a10ef0 100644 --- a/duoshuo/WordPress.php +++ b/duoshuo/WordPress.php @@ -337,19 +337,28 @@ public function appendScripts(){ static $once = 0; if ($once ++) return; -?> - - + + + + + + + wp_register_script('duoshuo-embed', $url, array(), null,true); - wp_enqueue_script('duoshuo-embed'); + wp_enqueue_script('duoshuo-embed'); + } } /** @@ -361,18 +370,24 @@ public function printScripts(){ if ($scriptsPrinted) return; - $duoshuo_shortname = 'static';?> - + + +