質問編集履歴
6
PHP追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,11 +16,9 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
```H
|
19
|
+
```PHP
|
20
20
|
|
21
|
-
コード
|
22
21
|
|
23
|
-
```
|
24
22
|
|
25
23
|
<?php
|
26
24
|
|
@@ -173,3 +171,7 @@
|
|
173
171
|
return preg_match($pattern, $_SERVER['HTTP_USER_AGENT']);
|
174
172
|
|
175
173
|
}
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
```
|
5
PHP追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
```
|
19
|
+
```HTML
|
20
20
|
|
21
21
|
コード
|
22
22
|
|
4
PHP追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,9 +14,11 @@
|
|
14
14
|
|
15
15
|
これが関係しているのでしょうか?
|
16
16
|
|
17
|
-
```
|
18
17
|
|
18
|
+
|
19
|
+
```PHP
|
20
|
+
|
19
|
-
|
21
|
+
コード
|
20
22
|
|
21
23
|
```
|
22
24
|
|
3
PHP追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,7 +14,9 @@
|
|
14
14
|
|
15
15
|
これが関係しているのでしょうか?
|
16
16
|
|
17
|
-
```
|
17
|
+
```
|
18
|
+
|
19
|
+
html
|
18
20
|
|
19
21
|
```
|
20
22
|
|
2
PHP追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,9 +14,7 @@
|
|
14
14
|
|
15
15
|
これが関係しているのでしょうか?
|
16
16
|
|
17
|
-
```ここに言語を入力
|
18
|
-
|
19
|
-
php
|
17
|
+
```php
|
20
18
|
|
21
19
|
```
|
22
20
|
|
1
PHP追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -3,3 +3,171 @@
|
|
3
3
|
原因はよくわかりませんが、サイトの速度を上げる一環でJavascriptの記述を最後尾にしているなどの理由が考えられるようです。
|
4
4
|
|
5
5
|
なるべく速度を遅くさせずに、Twenty20を使用できるようにしたいのですが、どういった方法がかんがえられますでしょうか?
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
(修正しました)
|
10
|
+
|
11
|
+
知識がないために混乱させてしまい、申し訳ありません。
|
12
|
+
|
13
|
+
構成要素を開いてみると、functions.phpというファイル内にWordpressの自動読み込みを解除という箇所がありました。
|
14
|
+
|
15
|
+
これが関係しているのでしょうか?
|
16
|
+
|
17
|
+
```ここに言語を入力
|
18
|
+
|
19
|
+
php
|
20
|
+
|
21
|
+
```
|
22
|
+
|
23
|
+
<?php
|
24
|
+
|
25
|
+
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
|
26
|
+
|
27
|
+
remove_action( 'wp_print_styles', 'print_emoji_styles' );
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
32
|
+
|
33
|
+
// WordPressがヘッダーで読み込むrsd_linkとwlwmanifest_linkを削除
|
34
|
+
|
35
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
36
|
+
|
37
|
+
function removeHeadLinks() {
|
38
|
+
|
39
|
+
remove_action('wp_head', 'rsd_link');
|
40
|
+
|
41
|
+
remove_action('wp_head', 'wlwmanifest_link');
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
add_action('init', 'removeHeadLinks');
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
52
|
+
|
53
|
+
// WordPressが自動読み込みするwp-embedスクリプト(Youtube等の動画埋め込み用スクリプト)を削除
|
54
|
+
|
55
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
56
|
+
|
57
|
+
function my_deregister_scripts(){
|
58
|
+
|
59
|
+
wp_deregister_script( 'wp-embed' );
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
add_action( 'wp_footer', 'my_deregister_scripts' );
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
68
|
+
|
69
|
+
// WordPressのjQuery自動読み込みを解除
|
70
|
+
|
71
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
72
|
+
|
73
|
+
function replace_jquery() {
|
74
|
+
|
75
|
+
if (!is_admin()) {
|
76
|
+
|
77
|
+
// comment out the next two lines to load the local copy of jQuery
|
78
|
+
|
79
|
+
wp_deregister_script('jquery');
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
add_action('init', 'replace_jquery');
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
92
|
+
|
93
|
+
// サムネイル表示の有効化
|
94
|
+
|
95
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
96
|
+
|
97
|
+
add_theme_support('post-thumbnails');
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
//更新日の追加
|
102
|
+
|
103
|
+
function get_mtime($format) {
|
104
|
+
|
105
|
+
$mtime = get_the_modified_time('Ymd');
|
106
|
+
|
107
|
+
$ptime = get_the_time('Ymd');
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
if ($ptime > $mtime) {
|
112
|
+
|
113
|
+
return get_the_time($format);
|
114
|
+
|
115
|
+
} elseif ($ptime === $mtime) {
|
116
|
+
|
117
|
+
return null;
|
118
|
+
|
119
|
+
} else {
|
120
|
+
|
121
|
+
return get_the_modified_time($format);
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
130
|
+
|
131
|
+
//スマホのみ条件分岐
|
132
|
+
|
133
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
134
|
+
|
135
|
+
function is_mobile(){
|
136
|
+
|
137
|
+
$useragents = array(
|
138
|
+
|
139
|
+
'iPhone', // iPhone
|
140
|
+
|
141
|
+
'iPod', // iPod touch
|
142
|
+
|
143
|
+
'Android.*Mobile', // 1.5+ Android *** Only mobile
|
144
|
+
|
145
|
+
'Windows.*Phone', // *** Windows Phone
|
146
|
+
|
147
|
+
'dream', // Pre 1.5 Android
|
148
|
+
|
149
|
+
'CUPCAKE', // 1.5+ Android
|
150
|
+
|
151
|
+
'blackberry9500', // Storm
|
152
|
+
|
153
|
+
'blackberry9530', // Storm
|
154
|
+
|
155
|
+
'blackberry9520', // Storm v2
|
156
|
+
|
157
|
+
'blackberry9550', // Storm v2
|
158
|
+
|
159
|
+
'blackberry9800', // Torch
|
160
|
+
|
161
|
+
'webOS', // Palm Pre Experimental
|
162
|
+
|
163
|
+
'incognito', // Other iPhone browser
|
164
|
+
|
165
|
+
'webmate' // Other iPhone browser
|
166
|
+
|
167
|
+
);
|
168
|
+
|
169
|
+
$pattern = '/'.implode('|', $useragents).'/i';
|
170
|
+
|
171
|
+
return preg_match($pattern, $_SERVER['HTTP_USER_AGENT']);
|
172
|
+
|
173
|
+
}
|