回答編集履歴

1

コメントを受けて追記

2019/04/19 02:57

投稿

yhg
yhg

スコア2161

test CHANGED
@@ -35,3 +35,45 @@
35
35
 
36
36
 
37
37
  のようにする必要があります。
38
+
39
+
40
+
41
+ # 追記(2019-04-19 11:57)
42
+
43
+ jQuery は初期状態で読み込まれるようになっているので、 `wp_enqueue_script('jquery',...)` は不要です。
44
+
45
+ また`jquery.rwdImageMaps.min.js`のURLが正しくないので、
46
+
47
+ functions.phpに
48
+
49
+
50
+
51
+ ```php
52
+
53
+ function theme_enqueue_scripts() {
54
+
55
+ wp_enqueue_script('jquery-rwdImageMaps', 'https://cdn.jsdelivr.net/gh/stowball/jQuery-rwdImageMaps/jquery.rwdImageMaps.min.js', ['jquery'], '1.6');
56
+
57
+ }
58
+
59
+
60
+
61
+ add_action( 'wp_enqueue_scripts', 'theme_enqueue_scripts' );
62
+
63
+ ```
64
+
65
+
66
+
67
+ のように記述し、
68
+
69
+
70
+
71
+ ````html
72
+
73
+ <script type="text/javascript" src="jquery.rwdImageMaps.min.js"></script>
74
+
75
+ ```
76
+
77
+ を削除してください。
78
+
79
+ jsDelivrというCDNサービスからjquery.rwdImageMaps.min.jsを読み込んでくれるようになります。