Wordpress条件标签“如果为空”

Need a bit of help if possible:

I have a custom field in my wordpress site, that if it is empty, to not display the div it is inputted into.

Here is what I have so far:

<?php
    $newsquote = $cfs->get('news_story_quote');

    if ( ! empty ( $newsquote ) )
    {
    ?>
    <div class="news-story-quote">

    <p><?php global $cfs; echo $cfs->get('news_story_quote'); ?></p>

    </div><!-- News Story Quote -->
    <?php   }   ?>

The way to call in the custom field is this : <?php global $cfs; echo $cfs->get('news_story_quote'); ?>

Any help would be appreciated

Probably, you dont use the function inside a loop.

$newsquote = $cfs->get('news_story_quote', $post_id);

if ($newsquote) : ?>

    <div class="news-story-quote">

    <p><?php echo $newsquote ?></p>

    </div><!-- News Story Quote -->

<?php endif ?>