質問編集履歴
3
php
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
header.php ファイルのエラーが直せない
|
test
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
こ
|
1
|
+
https://modern-code.com/http-error-symptom-that-media-can-not-be-uploaded-in-wordpress このサイトを参考にWordPressのテーマファイル内の「functions.php」を追加したところこのようなエラーがでました。
|
2
|
-
|
3
|
-
ちゃんと調べればよかった、、
|
4
2
|
|
5
3
|
|
6
4
|
|
@@ -8,7 +6,9 @@
|
|
8
6
|
|
9
7
|
|
10
8
|
|
9
|
+
そのサイトから追加したコードです
|
10
|
+
|
11
|
-
|
11
|
+
add_filter( 'wp_image_editors', 'change_graphic_lib' );
|
12
12
|
|
13
13
|
function change_graphic_lib($array) {
|
14
14
|
|
@@ -16,7 +16,9 @@
|
|
16
16
|
|
17
17
|
}
|
18
18
|
|
19
|
-
|
19
|
+
|
20
|
+
|
21
|
+
|
20
22
|
|
21
23
|
|
22
24
|
|
@@ -40,11 +42,9 @@
|
|
40
42
|
|
41
43
|
}
|
42
44
|
|
43
|
-
|
45
|
+
上のを追加したことが原因なのでこのコードを消そうとすると(以下引用)
|
44
46
|
|
45
47
|
wp-content/themes/giraffe/header.php ファイルの53行目のエラーのため、PHP コードの変更をロールバックしました。修正し、もう一度保存してください。
|
46
|
-
|
47
|
-
|
48
48
|
|
49
49
|
Uncaught Error: Call to undefined function is_mobile() in wp-content/themes/giraffe/header.php:53
|
50
50
|
|
2
php
test
CHANGED
File without changes
|
test
CHANGED
@@ -17,3 +17,55 @@
|
|
17
17
|
}
|
18
18
|
|
19
19
|
これをWordPressのテーマファイル内の「functions.php」に書き加えました
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
add_filter( 'wp_image_editors', 'change_graphic_lib' );
|
36
|
+
|
37
|
+
function change_graphic_lib($array) {
|
38
|
+
|
39
|
+
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
これを追加したことが原因なのでこのコードを消そうとすると
|
44
|
+
|
45
|
+
wp-content/themes/giraffe/header.php ファイルの53行目のエラーのため、PHP コードの変更をロールバックしました。修正し、もう一度保存してください。
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
Uncaught Error: Call to undefined function is_mobile() in wp-content/themes/giraffe/header.php:53
|
50
|
+
|
51
|
+
Stack trace:
|
52
|
+
|
53
|
+
#0 wp-includes/template.php(688): require_once()
|
54
|
+
|
55
|
+
#1 wp-includes/template.php(647): load_template('/home/kanataku/...', true)
|
56
|
+
|
57
|
+
#2 wp-includes/general-template.php(41): locate_template(Array, true)
|
58
|
+
|
59
|
+
#3 wp-content/themes/giraffe/home.php(1): get_header()
|
60
|
+
|
61
|
+
#4 wp-includes/template-loader.php(74): include('/home/kanataku/...')
|
62
|
+
|
63
|
+
#5 wp-blog-header.php(19): require_once('/home/kanataku/...')
|
64
|
+
|
65
|
+
#6 index.php(17): require('/home/kanataku/...')
|
66
|
+
|
67
|
+
#7 {main}
|
68
|
+
|
69
|
+
thrown
|
70
|
+
|
71
|
+
とでてしまいました。
|
1
ワードプレス
test
CHANGED
File without changes
|
test
CHANGED
@@ -5,3 +5,15 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
Fatal error: Uncaught Error: Call to undefined function is_mobile() in /home/kanataku/rouninn.com/public_html/wp-content/themes/giraffe/header.php:53 Stack trace: #0 /home/kanataku/rouninn.com/public_html/wp-includes/template.php(688): require_once() #1 /home/kanataku/rouninn.com/public_html/wp-includes/template.php(647): load_template('/home/kanataku/...', true) #2 /home/kanataku/rouninn.com/public_html/wp-includes/general-template.php(41): locate_template(Array, true) #3 /home/kanataku/rouninn.com/public_html/wp-content/themes/giraffe/home.php(1): get_header() #4 /home/kanataku/rouninn.com/public_html/wp-includes/template-loader.php(74): include('/home/kanataku/...') #5 /home/kanataku/rouninn.com/public_html/wp-blog-header.php(19): require_once('/home/kanataku/...') #6 /home/kanataku/rouninn.com/public_html/index.php(17): require('/home/kanataku/...') #7 {main} thrown in /home/kanataku/rouninn.com/public_html/wp-content/themes/giraffe/header.php on line 53
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
追加したコードですadd_filter( 'wp_image_editors', 'change_graphic_lib' );
|
12
|
+
|
13
|
+
function change_graphic_lib($array) {
|
14
|
+
|
15
|
+
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
|
16
|
+
|
17
|
+
}
|
18
|
+
|
19
|
+
これをWordPressのテーマファイル内の「functions.php」に書き加えました
|