質問するログイン新規登録

回答編集履歴

1

追記

2020/02/15 09:51

投稿

CHERRY
CHERRY

スコア25234

answer CHANGED
@@ -2,4 +2,32 @@
2
2
 
3
3
  リーピーターフィールドのデータ入力は、どこのページで入力されているでしょうか?
4
4
 
5
- 表示している固定ページで、入力されているでしょうか?
5
+ 表示している固定ページで、入力されているでしょうか?
6
+
7
+ ----
8
+ 追記
9
+
10
+ get_posts で、対象の PostType のデータを取得してから表示なので、こんな感じでしょうか。
11
+
12
+ ```
13
+ $args = array( 'post_type' => 'myoptions' );
14
+ $myposts = get_posts( $args );
15
+
16
+ foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
17
+ <?php if(have_rows('options_list')) : ?>
18
+ <table class="table02">
19
+ <tbody>
20
+ <?php while(have_rows('options_list')): the_row(); ?>
21
+ <tr>
22
+ <th>
23
+ <?php the_sub_field('options_list_name'); ?>
24
+ </th>
25
+ <td>
26
+ <?php the_sub_field('options_list_price'); ?>
27
+ </td>
28
+ </tr>
29
+ <?php endwhile; ?>
30
+ </tbody>
31
+ </table>
32
+ <?php endif; ?>
33
+ ```