質問編集履歴

2

簡易的なソースを追加。

2017/10/06 10:12

投稿

cat0138
cat0138

スコア33

test CHANGED
File without changes
test CHANGED
@@ -58,43 +58,45 @@
58
58
 
59
59
  ```
60
60
 
61
+ $args = array(
61
62
 
63
+ 'tax_query' => array(
62
64
 
63
- 'tax_query' => array(
65
+ array(
64
66
 
65
- array(
67
+ 'taxonomy' => 'case_cat', //カテゴリー
66
68
 
67
- 'taxonomy' => 'case_cat', //カテゴリー
69
+ 'field' => 'slug',
68
70
 
69
- 'field' => 'slug',
71
+ 'terms' => 〇〇〇,
70
72
 
73
+ ),
74
+
75
+ array(
76
+
77
+ 'taxonomy' => 'product_materials', //素材
78
+
79
+ 'field' => 'slug',
80
+
71
- 'terms' => 〇〇〇,
81
+ 'terms' => 〇〇〇,
82
+
83
+ ),
72
84
 
73
85
  ),
74
86
 
75
- array(
87
+ 'meta_query' => array(
76
88
 
77
- 'taxonomy' => 'product_materials', //素材
89
+ array(
78
90
 
79
- 'field' => 'slug',
91
+ 'key' => 'case_shape',//カスタムフィールド形状
80
92
 
81
- 'terms' => 〇〇〇,
93
+ 'value' => 〇〇〇,
82
94
 
83
- ),
95
+ ),
84
96
 
85
- ),
97
+ )
86
98
 
87
- 'meta_query' => array(
88
-
89
- array(
90
-
91
- 'key' => 'case_shape',//カスタムフィールド形状
92
-
93
- 'value' => 〇〇〇,
94
-
95
- ),
99
+ );
96
-
97
- )
98
100
 
99
101
 
100
102
 

1

現在のソースを記載

2017/10/06 10:12

投稿

cat0138
cat0138

スコア33

test CHANGED
File without changes
test CHANGED
@@ -49,3 +49,53 @@
49
49
  というコードを書いたのですが、実は閲覧数の順番に並び変えたいと知り、できれば一度に取得したいと思っております。
50
50
 
51
51
  また、コードの量も減らせればと考えています。
52
+
53
+
54
+
55
+ ###依頼したいこと
56
+
57
+ 下記ソースを例に、実装できるソースを教えていただけますと幸いです。
58
+
59
+ ```
60
+
61
+
62
+
63
+ 'tax_query' => array(
64
+
65
+ array(
66
+
67
+ 'taxonomy' => 'case_cat', //カテゴリー
68
+
69
+ 'field' => 'slug',
70
+
71
+ 'terms' => 〇〇〇,
72
+
73
+ ),
74
+
75
+ array(
76
+
77
+ 'taxonomy' => 'product_materials', //素材
78
+
79
+ 'field' => 'slug',
80
+
81
+ 'terms' => 〇〇〇,
82
+
83
+ ),
84
+
85
+ ),
86
+
87
+ 'meta_query' => array(
88
+
89
+ array(
90
+
91
+ 'key' => 'case_shape',//カスタムフィールド形状
92
+
93
+ 'value' => 〇〇〇,
94
+
95
+ ),
96
+
97
+ )
98
+
99
+
100
+
101
+ ```