WordPress.org

Ready to get started?Download WordPress

Forums

Video Thumbnails
Fancybox - Calling the Video from the Content (4 posts)

  1. welshhuw
    Member
    Posted 3 years ago #

    Hi,

    I want to use Fancybox to show the videos.

    I have gotten so far as to get fancybox to open when clicking on the video thumbnail, but the video is not appearing. A copy of the post is!

    How do I get the actual video to appear? Is there a php function I need to use. Here is my code:

    <a class="fancybox" href="<?php get_the_content(); ?>">
      <img src="<?php video_thumbnail(); ?>"width="264" height="149" />
    </a>
  2. Sutherland Boswell
    Member
    Plugin Author

    Posted 3 years ago #

    This isn't really a Video Thumbnails support question, but I think I know what you need to do.

    <a class="fancybox" href="#data<?php the_ID(); ?>"><img src="<?php video_thumbnail(); ?>"width="264" height="149" /></a>
    
    <div style="display:none"><div id="data<?php the_ID(); ?>"><?php $content = get_the_content(); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?></div></div>
  3. welshhuw
    Member
    Posted 3 years ago #

    Thanks for the quick reply Sutherland.

    A vimeo video loaded, but displayed slightly overlapping the fancybox, and the youtube only loaded the actual url link as a string.

    Is there perhaps a way to use this plugin with custom meta boxes?

    Appreciate your help greatly.

    Thanks

  4. Sutherland Boswell
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, this thread has a fix for using it with a custom meta box.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic