WordPress.org

Support

Support » How-To and Troubleshooting » How to hide empty custom field – post meta

How to hide empty custom field – post meta

Viewing 1 replies (of 1 total)
  • esmi

    @esmi

    Forum Moderator

    <?php
    if (have_posts()) : while (have_posts()) : the_post();
    if( get_post_meta(get_the_ID(), 'blog_thumb_image_url', true) ) :
    $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>
    <?php endif;?>
Viewing 1 replies (of 1 total)
  • The topic ‘How to hide empty custom field – post meta’ is closed to new replies.
Skip to toolbar