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