質問編集履歴
1
不慣れで申し訳ありません。修正いたしました。(コード→コードブロック表示、参考にしたサイトのリンクを追加。)
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,6 +44,8 @@
|
|
44
44
|
|
45
45
|
|
46
46
|
|
47
|
+
|
48
|
+
|
47
49
|
★P.S.★
|
48
50
|
|
49
51
|
元々、functions.phpに記述しているコードは以下で、
|
@@ -56,10 +58,14 @@
|
|
56
58
|
|
57
59
|
--------------------------------------------------------------------------------
|
58
60
|
|
61
|
+
```
|
62
|
+
|
59
63
|
<?php //子テーマで利用する関数を書く
|
60
64
|
|
61
65
|
|
62
66
|
|
67
|
+
|
68
|
+
|
63
69
|
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
|
64
70
|
|
65
71
|
function theme_enqueue_styles() {
|
@@ -98,6 +104,8 @@
|
|
98
104
|
|
99
105
|
|
100
106
|
|
107
|
+
```
|
108
|
+
|
101
109
|
★★★ この最後の部分にコード追加 ★★★
|
102
110
|
|
103
111
|
|
@@ -114,12 +122,14 @@
|
|
114
122
|
|
115
123
|
|
116
124
|
|
117
|
-
|
125
|
+
[参考にしたサイト★1番目](http://wordpress.hitsuji.me/how-to-accept-svg-image-files-in-wordpress/)
|
118
126
|
|
119
127
|
1番目のコード----------------------------------------------------
|
120
128
|
|
121
129
|
|
122
130
|
|
131
|
+
```
|
132
|
+
|
123
133
|
// SVGファイルに対応する
|
124
134
|
|
125
135
|
add_filter( 'upload_mimes', 'my_add_mime_type' );
|
@@ -190,12 +200,18 @@
|
|
190
200
|
|
191
201
|
|
192
202
|
|
203
|
+
```
|
204
|
+
|
193
205
|
-----------------------------------------------------------------
|
194
206
|
|
195
207
|
|
196
208
|
|
209
|
+
[[参考にしたサイト★2番目]](https://inthecom.net/1582)
|
210
|
+
|
197
211
|
2番目のコード----------------------------------------------------
|
198
212
|
|
213
|
+
```
|
214
|
+
|
199
215
|
function my_ext2type($ext2types) {
|
200
216
|
|
201
217
|
array_push($ext2types, array('image' => array('svg', 'svgz')));
|
@@ -234,12 +250,20 @@
|
|
234
250
|
|
235
251
|
|
236
252
|
|
253
|
+
|
254
|
+
|
255
|
+
```
|
256
|
+
|
237
257
|
-----------------------------------------------------------------
|
238
258
|
|
239
259
|
|
240
260
|
|
261
|
+
[[参考にしたサイト★3番目]](http://parashuto.com/rriver/development/check-points-for-using-svg-in-wordpress-article#customizing-functions-php)
|
262
|
+
|
241
263
|
3番目のコード----------------------------------------------------
|
242
264
|
|
265
|
+
```
|
266
|
+
|
243
267
|
function fix_svg_thumb_display() {
|
244
268
|
|
245
269
|
echo '
|
@@ -258,12 +282,18 @@
|
|
258
282
|
|
259
283
|
|
260
284
|
|
285
|
+
```
|
286
|
+
|
261
287
|
-----------------------------------------------------------------
|
262
288
|
|
263
289
|
|
264
290
|
|
291
|
+
[[参考にしたサイト★4番目]](https://www.webprofessional.jp/wordpress-svg/)
|
292
|
+
|
265
293
|
4番目のコード----------------------------------------------------
|
266
294
|
|
295
|
+
```
|
296
|
+
|
267
297
|
function add_file_types_to_uploads($file_types){
|
268
298
|
|
269
299
|
|
@@ -284,4 +314,6 @@
|
|
284
314
|
|
285
315
|
|
286
316
|
|
317
|
+
```
|
318
|
+
|
287
319
|
-----------------------------------------------------------------
|