Title: カスタムフィールド　AまたはB
Last modified: 2009年6月29日

---

# カスタムフィールド　AまたはB

 *  [popop](https://ja.wordpress.org/support/users/popop/)
 * (@popop)
 * [17年、 4ヶ月前](https://ja.wordpress.org/support/topic/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%80%80a%e3%81%be%e3%81%9f%e3%81%afb/)
 * カスタムフィールドで呼び出す場合は
    <?php echo post_custom(‘key’); ?> 同じ場所
   に2種類のkeyのうち、いずれかがあれば、呼び出すことはできますかね・・。

2件の返信を表示中 - 1 - 2件目 (全2件中)

 *  [trashforce](https://ja.wordpress.org/support/users/trashforce/)
 * (@trashforce)
 * [17年、 4ヶ月前](https://ja.wordpress.org/support/topic/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%80%80a%e3%81%be%e3%81%9f%e3%81%afb/#post-118854)
 * これはwordpressよりただのphpコーディング問題ですね。
 * <?php
    if(post_custom(‘key’) == ‘A’ || post_custom(‘key’) == ‘B’){ echo post_custom(‘
   key’); } ?>
 *  [shokun0803](https://ja.wordpress.org/support/users/shokun0803/)
 * (@shokun0803)
 * [17年、 4ヶ月前](https://ja.wordpress.org/support/topic/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%80%80a%e3%81%be%e3%81%9f%e3%81%afb/#post-118855)
 * 「2種類のkeyのうち、いずれかがあれば」の条件式なら
 *     ```
       <?php
       if(post_custom('key1') != '' || post_custom('key2') != ''){
       echo "ok";
       }
       ?>
       ```
   
 * ですかね;)
    キーの中身が2種かな？？？

2件の返信を表示中 - 1 - 2件目 (全2件中)

 トピック「カスタムフィールド　AまたはB」には新たに返信することはできません。

 * フォーラム: [使い方全般](https://ja.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2件の返信
 * 3人の参加者
 * 最後の返信者: [shokun0803](https://ja.wordpress.org/support/users/shokun0803/)
 * 最後の活動: [17年、 4ヶ月前](https://ja.wordpress.org/support/topic/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%80%80a%e3%81%be%e3%81%9f%e3%81%afb/#post-118855)
 * 状態: 未解決

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
