以下の例は、変数 $custom_fields に 現在の 投稿のすべてのカスタムフィールド情報を(多次元の)配列で取得します。 <?php $custom_fields = get_post_custom(); ?> カスタムフィールドの配列からデータを取得する 以下のサンプルは、ID 72 の投稿から my_custom_field というキーを持つすべてのカスタムフィールドの値を取得します。ここでは、このキーを持つカスタムフィールドは 3 つあり、値はそれぞれ「犬」、「47」、「その他の値」とします。 <?php $custom_fields = get_post_custom( 72 ); $my_custom_field = $custom_fields[ 'my_custom_field' ]; foreach ( $my_custom_field as $key => $va