SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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:

    www.yourvancouvermortgagebroker.ca

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

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,585
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    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:

    Code:
    <img width="406" height="226" src="http://www.yourvancouvermortgagebroker.ca/wp-content/uploads/2010/12/Vancouver-Mortgage-Broker-406x226.jpg" 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:

    Code:
    <iframe width="406" height="226" src="http://www.youtube.com/embed/EbKa-Qs1dVc?rel=0" 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. )

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

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Thanks

  4. #4
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thanks for this help

    Quote Originally Posted by ralph.m View Post
    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:

    Code:
    <img width="406" height="226" src="http://www.yourvancouvermortgagebroker.ca/wp-content/uploads/2010/12/Vancouver-Mortgage-Broker-406x226.jpg" 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:

    Code:
    <iframe width="406" height="226" src="http://www.youtube.com/embed/EbKa-Qs1dVc?rel=0" 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. )

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

  5. #5
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can u suggest me how to select an image or video from the post, because i use video in few posts only

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,585
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by irfan75_04 View Post
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •