回答編集履歴
1
修正
answer
CHANGED
@@ -1,3 +1,21 @@
|
|
1
1
|
自分なら、以下の手順で実装します。
|
2
2
|
1. カテゴリーのリストを取得
|
3
|
-
2. カテゴリーごとに、WP_Queryのリストを取得
|
3
|
+
2. カテゴリーごとに、WP_Queryのリストを取得
|
4
|
+
|
5
|
+
while、foreachなど、ループは2重になるはずです。
|
6
|
+
```
|
7
|
+
while (カテゴリーを取得) {
|
8
|
+
カテゴリーのタイトルを表示
|
9
|
+
|
10
|
+
while (取得したカテゴリーごとに記事を取得) {
|
11
|
+
記事を表示
|
12
|
+
}
|
13
|
+
}
|
14
|
+
```
|
15
|
+
|
16
|
+
---
|
17
|
+
|
18
|
+
以下、参考になりそうです。
|
19
|
+
[https://naoyu.net/tax_query/](https://naoyu.net/tax_query/)
|
20
|
+
[https://illustswitch.com/wp/posts-by-category/](https://illustswitch.com/wp/posts-by-category/)
|
21
|
+
[https://hirashimatakumi.com/blog/4147.html](https://hirashimatakumi.com/blog/4147.html)
|