回答編集履歴

1

加筆修正

2019/02/19 05:17

投稿

退会済みユーザー
test CHANGED
@@ -1,3 +1,35 @@
1
1
  [テンプレートタグ/get posts - WordPress Codex 日本語版](https://wpdocs.osdn.jp/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0/get_posts)
2
2
 
3
3
  orderbyとかorderを使うっぽい?
4
+
5
+
6
+
7
+ ```
8
+
9
+ $args = array(
10
+
11
+ 'posts_per_page' => $num,
12
+
13
+ 'post_type' => $postTypeName,
14
+
15
+ 'tax_query' => array(
16
+
17
+ array(
18
+
19
+ 'taxonomy' => $taxonomy,
20
+
21
+ 'field' => 'slug',
22
+
23
+ 'terms' => $term->slug,
24
+
25
+ )
26
+
27
+ ),
28
+
29
+ 'orderby' => 'date',
30
+
31
+ 'order' => 'DESC',
32
+
33
+ );
34
+
35
+ ```