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
![wordpress カスタムフィールドテンプレートで項目に記入のない場合は非表示 | WEBデザイナーのしおり](https://cdn-ak-scissors.b.st-hatena.com/image/square/e9b56d27f07a1577454577e24b9ae7610c448ace/height=288;version=1;width=512/http%3A%2F%2Fmsweb.moo.jp%2Fwordpress%2Fwp-content%2Fuploads%2F971-2.jpg)