Support » Plugin: Featured Video Plus » How to check if featured video is attached to post?

  • I am looking for the way to display video with shortcode only if it exists and is attached to the post.

    How can I do that?

    Is this function for that?
    has_post_video()

    So will this work?
    <?php if( has_post_video() ): ?>
    <?php echo do_shortcode('[featured-video-plus]'); ?>
    <?php endif; ?>

Viewing 1 replies (of 1 total)
  • Figured it out. has_post_video() returns boolean value, so it worked in the end.
    Thanks to author for providing such a useful function.

    • This reply was modified 3 years, 2 months ago by @anansi.pro.
Viewing 1 replies (of 1 total)
  • The topic ‘How to check if featured video is attached to post?’ is closed to new replies.