回答編集履歴
2
誤字の修正
test
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
```
|
6
6
|
|
7
|
-
add_action( 'wp_enqueue_scripts', 'my_jq
|
7
|
+
add_action( 'wp_enqueue_scripts', 'my_jquery_change' );
|
8
8
|
|
9
|
-
function my_jq
|
9
|
+
function my_jquery_change(){
|
10
10
|
|
11
11
|
wp_deregister_script( 'jquery' );
|
12
12
|
|
@@ -32,17 +32,17 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
たとえば、new-jquery
|
35
|
+
たとえば、new-jquery.php テンプレートだけに、異なる jQuery を適用するのであれば、こんな感じでしょうか。
|
36
36
|
|
37
37
|
|
38
38
|
|
39
39
|
```
|
40
40
|
|
41
|
-
add_action( 'wp_enqueue_scripts', 'my_jq
|
41
|
+
add_action( 'wp_enqueue_scripts', 'my_jquery_change' );
|
42
42
|
|
43
|
-
function my_jq
|
43
|
+
function my_jquery_change(){
|
44
44
|
|
45
|
-
if( is_page_template( 'new-jquery
|
45
|
+
if( is_page_template( 'new-jquery.php' ) ){
|
46
46
|
|
47
47
|
wp_deregister_script( 'jquery' );
|
48
48
|
|
1
修正
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
wp_deregister_script( 'jquery' );
|
12
12
|
|
13
|
-
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/
|
13
|
+
wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js', array(), NULL, true);
|
14
14
|
|
15
15
|
wp_enqueue_script('jquery');
|
16
16
|
|