Title: Slide Description / Caption conditional
Last modified: August 31, 2016

---

# Slide Description / Caption conditional

 *  Resolved [Schalk Joubert](https://wordpress.org/support/users/schalkjoubert/)
 * (@schalkjoubert)
 * [10 years ago](https://wordpress.org/support/topic/slide-description-caption-conditional/)
 * Hi,
    I am displaying a description on some slides only. The description is styled
   with background and border. How do I NOT display the styling for slides withoutt
   a description?
 * IF DESCRIPTION EXIST:
 *     ```
       <?php // Get the featured image's description
       	$ms_thumb_id = get_post_thumbnail_id($id);
       	$ms_description = esc_attr( get_post_field( 'post_content', $ms_thumb_id ) );
       	echo '<span class="meteor-description">' . $ms_description . '</span>';?>
       ```
   
 * Thank you,
 * [https://wordpress.org/plugins/meteor-slides/](https://wordpress.org/plugins/meteor-slides/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Josh Leuze](https://wordpress.org/support/users/jleuze/)
 * (@jleuze)
 * [10 years ago](https://wordpress.org/support/topic/slide-description-caption-conditional/#post-7436757)
 * Hi, you can do this by checking if there is a description and making the caption
   output conditional:
 *     ```
       <?php // Get the featured image's description
       $ms_thumb_id    = get_post_thumbnail_id( $id );
       $ms_description = esc_attr( get_post_field( 'post_content', $ms_thumb_id ) );
       if ( !empty( $ms_description ) ) {
       	echo '<span class="meteor-description">' . $ms_description . '</span>';
       } ?>
       ```
   
 *  Thread Starter [Schalk Joubert](https://wordpress.org/support/users/schalkjoubert/)
 * (@schalkjoubert)
 * [10 years ago](https://wordpress.org/support/topic/slide-description-caption-conditional/#post-7436762)
 * Josh,
    Thank you so very much! It works perfectly! Super support! Regards schalk
 *  Plugin Author [Josh Leuze](https://wordpress.org/support/users/jleuze/)
 * (@jleuze)
 * [10 years ago](https://wordpress.org/support/topic/slide-description-caption-conditional/#post-7436765)
 * No problem, glad to help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Slide Description / Caption conditional’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/meteor-slides_0f131a.svg)
 * [Meteor Slides](https://wordpress.org/plugins/meteor-slides/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/meteor-slides/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/meteor-slides/)
 * [Active Topics](https://wordpress.org/support/plugin/meteor-slides/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/meteor-slides/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/meteor-slides/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Josh Leuze](https://wordpress.org/support/users/jleuze/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/slide-description-caption-conditional/#post-7436765)
 * Status: resolved