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

回答編集履歴

1

追記

2018/03/19 06:05

投稿

退会済みユーザー
answer CHANGED
@@ -8,4 +8,31 @@
8
8
  [タームを出力する方法の種類を募集しています。](https://ja.wordpress.org/support/topic/%E3%82%BF%E3%83%BC%E3%83%A0%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%81%AE%E7%A8%AE%E9%A1%9E%E3%82%92%E5%8B%9F%E9%9B%86%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82/)
9
9
 
10
10
 
11
- とりあえず『なぜそうなのか、なぜそうなるのか』という事を理解しない限り堂々巡りでしょうね。
11
+ とりあえず『なぜそうなのか、なぜそうなるのか』という事を理解しない限り堂々巡りでしょうね。
12
+
13
+
14
+ ** 追記**
15
+
16
+ また頓珍漢してた…
17
+
18
+ こんな形でいいのでは?
19
+ ```
20
+ $mypost = get_posts(array(
21
+ 'numberposts' => 1,
22
+ 'post_type' => 'custompost1',
23
+ 'orderby' => 'rand'
24
+ ));
25
+ $field_eat = get_post_meta($mypost[0]->ID,'field_eat',true);
26
+ $fruits = get_the_terms($mypost[0],'fruits');
27
+ $fruit_name = '';
28
+ foreach( $fruits as $fruit ) {
29
+ $fruit_name .= $fruit->name;
30
+ }
31
+ $params = array(
32
+ 'status' => "$field_eat"."\n"."$fruit_name"."\n". get_permalink($mypost[0]->ID)
33
+ );
34
+ ```
35
+
36
+ 追伸
37
+ wgetで確認しましたか?
38
+ [https://teratail.com/questions/117503](https://teratail.com/questions/117503)