Help embedding a Youtube video in Wordpress slider

Hey guys,

I am using an Elegant Theme which has a slider on the home page. By default, the slider uses featured images, but I would like one of the slides to have an embedded youtube video instead.

I have tried the theme support forums, but it looks like this feature is not supported.

Anyway, I am trying to soldier through. Here is the website:

Can someone give me an idea of what the initial steps would be, or will this be kind of a nightmare? Thanks

I just tried an experiment in Chrome of replace the <img> element in your slider with a YouTube embedded video, and it worked perfectly.

Here was the image code:

<img width="[COLOR="#FF0000"]406[/COLOR]" height="[COLOR="#FF0000"]226[/COLOR]" src="" class="thumb wp-post-image" alt="Vancouver Mortgage Broker Photos" title="Vancouver Mortgage Broker Photos">

and I just replaced it with embed code from YouTube:

<iframe width="406" height="226" src="" frameborder="0" allowfullscreen></iframe>

The only change I made to the code was the dimensions of the video, to match those of the image it replaced.

I’m not sure how you insert this via WP, but hopefully you can just place the embed code where you would place the image. (If it’s a big problem, just get a better CMS. :rolleyes: )

You can grad the embed code for videos on YouTube by clicking the Share button under a vid and then Embed.

Thanks for the tip. Will be a little tricky with WP since it’s all done with PHP but I will replace that one area in the index.php with basic HTML.

can u suggest me how to select an image or video from the post, because i use video in few posts only

It’s not really clear what you are asking here. Anyhow, start a new thread, with as much info as possible. :slight_smile: