質問編集履歴

2

ソースコードの追加

2019/01/15 06:41

投稿

komiglas
komiglas

スコア18

test CHANGED
File without changes
test CHANGED
@@ -86,6 +86,132 @@
86
86
 
87
87
  ```ここに言語を入力
88
88
 
89
+
90
+
91
+ /* ----------------------------------------------------------------------------------
92
+
93
+ カスタム投稿タイプ
94
+
95
+ ---------------------------------------------------------------------------------- */
96
+
97
+ add_action('init', 'create_post_type');
98
+
99
+ function create_post_type() {
100
+
101
+ // 制作実績
102
+
103
+ $works_labels = array(
104
+
105
+ 'name' => '制作実績',
106
+
107
+ 'menu_name' => '制作実績',
108
+
109
+ 'singular_name' => '制作実績',
110
+
111
+ 'add_new_item' => '新しい制作実績を追加',
112
+
113
+ 'add_new' => '新規追加',
114
+
115
+ 'new_item' => '新しい制作実績',
116
+
117
+ 'view_item' => '制作実績を見る',
118
+
119
+ 'edit_item' => '制作実績を編集',
120
+
121
+ 'search_items' => '制作実績を検索',
122
+
123
+ 'not_found' => '制作実績が見つかりません',
124
+
125
+ 'not_found_in_trash' => 'ゴミ箱に制作実績はありません',
126
+
127
+ 'parent_item_colon' => '親の制作実績:',
128
+
129
+ );
130
+
131
+ $works_args = array(
132
+
133
+ 'taxonomies' => array('works_taxonomy'),
134
+
135
+ 'labels' => $works_labels,
136
+
137
+ 'hierarchical' => true,
138
+
139
+ 'description' => '',
140
+
141
+ 'supports' => array('title','editor','thumbnail','excerpt','custom-fields'),
142
+
143
+
144
+
145
+ 'public' => true,
146
+
147
+ 'show_ui' => true,
148
+
149
+ 'show_in_menu' => true,
150
+
151
+
152
+
153
+ 'show_in_nav_menus' => true,
154
+
155
+ 'publicly_queryable' => true,
156
+
157
+ 'exclude_from_search' => false,
158
+
159
+ 'has_archive' => true,
160
+
161
+ 'query_var' => true,
162
+
163
+ 'can_export' => true,
164
+
165
+ 'rewrite' => array( "slug" => "works", "with_front" => false ),
166
+
167
+ 'menu_icon' => 'dashicons-images-alt2',
168
+
169
+ 'capability_type' => 'post',
170
+
171
+ 'menu_position' => 5,
172
+
173
+ );
174
+
175
+ register_post_type('works', $works_args);
176
+
177
+
178
+
179
+ // 制作実績のタクソノミー
180
+
181
+ register_taxonomy(
182
+
183
+ 'works_taxonomy',
184
+
185
+ array('works'),
186
+
187
+ array(
188
+
189
+ 'hierarchical' => true,
190
+
191
+ 'update_count_callback' => '_update_post_term_count',
192
+
193
+ 'label' => 'ジャンル',
194
+
195
+ 'singular_label' => 'ジャンル',
196
+
197
+ 'public' => true,
198
+
199
+ 'show_ui' => true,
200
+
201
+ 'query_var' => true,
202
+
203
+ 'rewrite' => array( "slug" => "works", "with_front" => false )
204
+
205
+ )
206
+
207
+ );
208
+
209
+ }
210
+
211
+
212
+
213
+
214
+
89
215
  // カスタムナビゲーションにてカテゴリーリスト作成
90
216
 
91
217
  register_nav_menus(array('menu-categorise' => 'works_category_list'));

1

誤字脱字がありました。

2019/01/15 06:41

投稿

komiglas
komiglas

スコア18

test CHANGED
File without changes
test CHANGED
@@ -188,7 +188,7 @@
188
188
 
189
189
 
190
190
 
191
- <ul id="#articleOuter">
191
+ <ul id="articleOuter">
192
192
 
193
193
  <?php
194
194