How to hide empty custom field – post meta
-
Hi,
I want to hide a custom field when it’s empty. In the theme I’m using it is built like below:<?php if (have_posts()) : while (have_posts()) : the_post(); $image_thumb = get_post_meta(get_the_ID(), 'blog_thumb_image_url', true); ?> <div class="post_img"> <img src="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/timthumb.php?src=<?php echo $image_thumb; ?>&h=300&w=600&zc=1" alt="" /> </div>
I thought to move the <img> in the php function with an echo but really don’t know how to do…Anyone knows it?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to hide empty custom field – post meta’ is closed to new replies.