質問編集履歴

4

コードにコメント追加

2017/04/09 11:32

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  一部カスタム投稿タイプにACFリピーターで関連を使用しているのですが、
6
6
 
7
- ACFリピーターを使用しているアーカイブで最新1件(この場合はASCなので一番古い記事)しか出ず他のカスタム投稿タイプが表示されません。
7
+ ACFリピーターを使用しているカスタム投稿タイプのみアーカイブで最新1件(この場合はASCなので一番古い記事)しか出ず他のカスタム投稿タイプが表示されません。
8
8
 
9
9
 
10
10
 
@@ -52,6 +52,10 @@
52
52
 
53
53
  ##ACFの関連を入れているソース
54
54
 
55
+ コメントの間を削除すると、全て複数のカスタム投稿タイプが表示されます。
56
+
57
+
58
+
55
59
  ```ここに言語を入力
56
60
 
57
61
  <?php if(get_post_type()=='biography'): ?>
@@ -120,6 +124,8 @@
120
124
 
121
125
  <?php endif;?>
122
126
 
127
+ <!--ここから削除-->
128
+
123
129
  <?php $posts = get_sub_field('event_a_places02'); if( $posts ): ?>
124
130
 
125
131
  <?php foreach( $posts as $post): ?>
@@ -130,6 +136,8 @@
130
136
 
131
137
  <?php endif; ?>
132
138
 
139
+ <!--ここまで削除-->
140
+
133
141
  </p>
134
142
 
135
143
  </dd>
@@ -186,6 +194,8 @@
186
194
 
187
195
  <?php endif; ?>
188
196
 
197
+ <!--ここから削除-->
198
+
189
199
  <?php $posts = get_sub_field('event_b_places02'); if( $posts ): ?>
190
200
 
191
201
  <?php foreach( $posts as $post): ?>
@@ -196,6 +206,8 @@
196
206
 
197
207
  <?php endif; ?>
198
208
 
209
+ <!--ここまで削除-->
210
+
199
211
  </p>
200
212
 
201
213
  </dd>

3

ソースの修正

2017/04/09 11:32

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -216,7 +216,7 @@
216
216
 
217
217
  <?php elseif ( get_post_type() == 'other' ): ?>
218
218
 
219
- <?php if ( is_object_in_term( $post->ID, 'other_cat', array( 'single', 'album', 'dvd' ) ) ): ?>
219
+ <?php if ( is_object_in_term( $post->ID, 'other_cat', array( 'other01', 'other02', 'other03' ) ) ): ?>
220
220
 
221
221
  <div class="otherBlock00">
222
222
 

2

コードの修正

2017/04/09 08:38

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -54,6 +54,24 @@
54
54
 
55
55
  ```ここに言語を入力
56
56
 
57
+ <?php if(get_post_type()=='biography'): ?>
58
+
59
+ <?php
60
+
61
+ $date = date_create( get_field( 'first_date' ) );
62
+
63
+ echo date_format( $date, 'Y/m/d' );
64
+
65
+ ?>
66
+
67
+ <?php the_title(); ?>
68
+
69
+ </h4>
70
+
71
+
72
+
73
+
74
+
57
75
  <?php elseif(get_post_type()=='schedule'&&get_post_status () == 'private' ): ?>
58
76
 
59
77
  <?php if (is_object_in_term($post->ID, 'schedule_cat','scheduleA')): ?>
@@ -188,6 +206,94 @@
188
206
 
189
207
  <?php endif; ?>
190
208
 
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <?php endif; ?>
216
+
217
+ <?php elseif ( get_post_type() == 'other' ): ?>
218
+
219
+ <?php if ( is_object_in_term( $post->ID, 'other_cat', array( 'single', 'album', 'dvd' ) ) ): ?>
220
+
221
+ <div class="otherBlock00">
222
+
223
+ <h4 class="bold">
224
+
225
+ <span class="small"><?php
226
+
227
+ $terms = get_the_terms($post->ID,'other_cat');
228
+
229
+ foreach( $terms as $term ) {
230
+
231
+ echo $term->name;
232
+
233
+ }
234
+
235
+ ?></span>
236
+
237
+ <?php
238
+
239
+ $date = date_create( get_field( 'first_date' ) );
240
+
241
+ echo date_format( $date, 'Y/m/d' );
242
+
243
+ ?>発売
244
+
245
+ <?php if(post_custom('event_concept_title')): ?>
246
+
247
+ <?php the_sub_field('event_concept_title'); ?>
248
+
249
+ <?php endif; ?>
250
+
251
+
252
+
253
+ <?php the_title(); ?>」</h4>
254
+
255
+ <dl class="otherBox00">
256
+
257
+ <dd>
258
+
259
+ <?php if(have_rows('other')): ?>
260
+
261
+ <?php while(have_rows('other')): the_row(); ?>
262
+
263
+ <dl>
264
+
265
+
266
+
267
+ <dt>
268
+
269
+ <img src="<?php the_sub_field('other_jacket'); ?>">
270
+
271
+ </dt>
272
+
273
+ <dd><?php the_sub_field('other_type'); ?></dd>
274
+
275
+ </dl>
276
+
277
+ <?php endwhile; ?>
278
+
279
+ <?php endif; ?>
280
+
281
+ </dd>
282
+
283
+ </dl>
284
+
285
+ </div>
286
+
287
+ <?php endif; ?>
288
+
289
+
290
+
291
+ <?php else :?>
292
+
293
+
294
+
295
+ <?php endif;?>
296
+
191
297
  ```
192
298
 
193
299
 

1

文言修正

2017/04/09 08:36

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  一部カスタム投稿タイプにACFリピーターで関連を使用しているのですが、
6
6
 
7
- ACFリピーターを使用しているもののみの1件しか出ず他のカスタム投稿タイプが表示されません。
7
+ ACFリピーターを使用しているもののみのアーカイブで最新1件(この場合はASCなので一番古い記事)しか出ず他のカスタム投稿タイプが表示されません。
8
8
 
9
9
 
10
10