wordpressカスタマイズ Tag

 

get_post_custom()

18 1月 2014, Posted by Teppei Tokikawa in WordPress, プログラミング

  wordpressでカスタムフィールドから情報を取得する方法。   $custom_fields = get_post_custom($post_id); print_r($custom_fields);     $post_idは指定しない場合は現在の投稿情報が取得できます。       更にカスタムフィールドの画像情報を取得する場合。   $res = wp_get_attachment_image_src($custom_fields['image_1'][0], 'thumnail&…