質問編集履歴

1

現在のコードを追加

2018/01/29 10:37

投稿

musashidayo
musashidayo

スコア54

test CHANGED
File without changes
test CHANGED
@@ -33,3 +33,39 @@
33
33
  この部分の良い書き方で特に悩んでいます。
34
34
 
35
35
  よろしくお願いします。
36
+
37
+
38
+
39
+
40
+
41
+ 追記
42
+
43
+ ```
44
+
45
+ <?php
46
+
47
+ $wp_query = new WP_Query();
48
+
49
+ $my_posts = array(
50
+
51
+ 'post_type' => 'post',
52
+
53
+ 'category_name' => '50音順の◯行のスラッグ',
54
+
55
+ );
56
+
57
+ $wp_query->query( $my_posts );
58
+
59
+ if( $wp_query->have_posts() ): while( $wp_query->have_posts() ) : $wp_query->the_post();
60
+
61
+ ?>
62
+
63
+ <!--ここにループする内容-->
64
+
65
+ <li><a href="<?php the_permalink(); ?>"><?php the_field('人物名'); ?></a></li>
66
+
67
+ <?php endwhile; endif; wp_reset_postdata(); ?>
68
+
69
+ ```
70
+
71
+ 現在はこのような方法であ〜わ行まで分けて出力しています。