Support

Account

Home Forums Add-ons Gallery Field if image caption exists

Solved

if image caption exists

  • I would like to style the image caption only if a caption exists for the image i.e. enclose it in a div. Any idea how you do an “if caption exists: statement for the Gallery field?

  • Okay, I’ve figured this out:

    
    <?php if( $image['caption'] ): ?>
    <div class="caption"><?php echo $image['caption']; ?></div>
    <?php endif; ?>
    
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘if image caption exists’ is closed to new replies.