Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Video Lightbox not working. WordPress


I have a site The theme comes with a gallery templated page, however when you click on the image it doesn't lightbox the video.

Not sure how to fix this

user: wpquestions
password: wpquestions

any suggestions?

Answers (1)


Pixel Coder answers:

Hi there Kayode, I took a look at your page here.

You have a video titled "cutest dog ever", and the image thumbnail above that is placed within a link.

If you look at the site code and find this line.

<a href="" rel="lightbox"><img src="" alt=""></a>

You will notice the

<a href="" rel="lightbox">

What triggers the lightbox is the "rel" value... However the lightbox looks for to play the video is a path to the video file which should be placed within the quotes here

<a href="this-should-be-a-path-to-your-video.swf" rel="lightbox">

You could do something like this.

<a href="" rel="lightbox">
<img src="" alt="">

I tried to login to your site although it appears the username and password above do not work.

Hope that helps you, any other issues please say so.

Edit* also on a side note, the image also has an attribute "alt" which is used for search engines, screen readers and alike when browsing your content. Search engine spiders are blind and there is also the possibility those with disabilities are also. You should place some descriptive text here and reap the benefits of well structured web site.

kayode brown comments:

Thanks for the rapid reply. I fixed the password so you can log in.

I'm using a plugin (nyvideo poster 2) that automatically grabs the youtube video from a specified channel and creates a post. It will place the thumbnail image along with the video url in any custom field I specify.

The fix you mentioned above how do I implement it so it will work automatically, or would i have to manually enter?

I need it to be automated.

Pixel Coder comments:

Hi again, I noticed the password was working now.

Coming up with a solution as we speak and will let you know when it is live.

Is that okie with you?

kayode brown comments:

Perfect. I will stop playing with it until you reply.

Pixel Coder comments:

Okie thank you.

Pixel Coder comments:

Hi again, looking at the nyvideo poster 2 plugin I have a feeling there will be clashed with the theme you are using here.

The theme outputs a specific value you enter for the video and the plugin makes a post with it's own criteria using the body, title and placing a video based on the url.

How they attach the video are not identical which without digging into lines of code is a fair assumption.

If it the end of the World if you stop using nyvideo poster 2?

kayode brown comments:

Is the option of making a template that looks similar to the original that will work with the plug in feasible?

Pixel Coder comments:

Well we could create this from the start but that would be going against the grain of purchasing a premium theme in the first place.

The template does work, if you look at it here...

I've hard coded a video to all the thumbnails, so you will see the same video for each now.

It uses a custom field value for each video, and I think the lightbox expects a certain url format... More specifically those on YouTube in this format.

Almost there....

Pixel Coder comments:

Kayode, hello again.

It all seems to be working now. If there are core functional modifications required it's a little bit outside the scope of this question.

There doesn't actually appear to be anything wrong with the theme itself, you really have to follow the criteria it asks for when making a post.

If you take a look at the "cutest dog post" and how the video has been attached that will give you guidance on how to create that in the future.

Hope that helps you.


kayode brown comments:

Thanks for the suggestions. I know the site works fine but I really want to make the plugin work. Can u let me know what u think the cost would be to make it happen

Pixel Coder comments:

No problems mate,

I've made some edits to the theme and it should now all work. Provided you stick to using YouTube and not other video hosting sites.

Here are the edits below.

File: portfolio-post.php

$youtubeurl= get_post_meta($post->ID, 'youtubeurl', true);
$out .= '<a href="'.$youtubeurl.'" rel="lightbox"><img src="'.$thumb_path.'" alt="Sample" /></a>

If you run into troubles in the future, restore this file and it will go back to the default functionality.

Hope that's got you all set now, any issues just say.

Pixel Coder comments:

Ah not quite there yet, you need some thumbnails appearing also.

Hang tight.

Pixel Coder comments:

Hi again couple of things to note.

The description on the /videos page has had to be sacrificed for speed in fixing this as it was outputing the embed code regardless of the setting checked in the My Video Poster plugin.

Also within each /video-single page there were pretty significant display issues with the large thumbnail to the top so that has now been removed.

There are still some aesthetic issues that i'd like to fix however must get on with some work here.

Did that help you?

Pixel Coder comments:

Meh this is why I don't like "one-size-fits-all" themes. The blog is not excluding videos from its list.