質問編集履歴

1

情報の追加

2020/06/15 07:07

投稿

cafe1111
cafe1111

スコア62

test CHANGED
File without changes
test CHANGED
@@ -188,6 +188,86 @@
188
188
 
189
189
 
190
190
 
191
-
192
-
193
191
  ```
192
+
193
+
194
+
195
+ ```php
196
+
197
+ //追加
198
+
199
+ //functions.php
200
+
201
+ function init_func(){
202
+
203
+ add_theme_support('title-tag');
204
+
205
+ add_theme_support('post-thumbnails');
206
+
207
+
208
+
209
+ register_post_type('notice',[
210
+
211
+ 'labels' => [
212
+
213
+ 'name' => 'お知らせ',
214
+
215
+ 'singular_name' => 'お知らせ',
216
+
217
+ 'add_new' => 'お知らせを追加',
218
+
219
+ 'add_new_item' => 'お知らせを追加',
220
+
221
+ 'edit_item' => 'お知らせを編集',
222
+
223
+ 'new_item' => '新しいお知らせ',
224
+
225
+ 'all_items' => '全てのお知らせ',
226
+
227
+ 'view_item' => 'お知らせを見る',
228
+
229
+ 'search_items' => 'お知らせを探す',
230
+
231
+ 'not_found' => 'お知らせは見つかりませんでした',
232
+
233
+ 'not_found_in_trash' => 'ゴミ箱は空です',
234
+
235
+ 'parent_item_colon' => '',
236
+
237
+ 'menu_name' => 'お知らせ'
238
+
239
+
240
+
241
+ ],
242
+
243
+ 'public' => true,
244
+
245
+ 'has_archive' => true,
246
+
247
+ 'hierarchical' => false,
248
+
249
+ 'supports' => [
250
+
251
+ 'title',
252
+
253
+ 'editor',
254
+
255
+ 'page-attributes'
256
+
257
+ ],
258
+
259
+ 'menu_position' => 4,
260
+
261
+ 'menu_icon' => 'dashicons-warning'
262
+
263
+ ]);
264
+
265
+ }
266
+
267
+ add_action('init','init_func');
268
+
269
+
270
+
271
+
272
+
273
+ ```