wordpress カスタムフィールドテンプレートで項目に記入のない場合は非表示 2012年9月4日 Tag:Wordpress | カスタムフィールドテンプレート | テンプレートタグ | 画像 1.パターン1(画像の場合) <?php $files = get_post_meta($post->ID, サブ画像1, false); foreach($files as $file): $file = wp_get_attachment_url($file); if ( !empty( $file ) ) : ?> <?php $image = wp_get_attachment_image_src( get_post_meta($post->ID, 'サブ画像1', true),'full' ); ?> <a href="<?php echo $image[0];?>" rel="lig