WordPress.org

Ready to get started?Download WordPress

Forums

Responsive
[resolved] Can't embedd YouTube vid into page (15 posts)

  1. DanPWhalen
    Member
    Posted 1 year ago #

    I'm trying to embed YouTube video into a post. I want the video to show up all the way to the right, and for the text to wrap around it.

    This is the code i was trying to use in the page. Its not working, there's just no video that shows up at all on the page. Page looks same as it would if I hadn't of added anything. Whats wrong with the code?

    <div style="float: right;"><iframe src="http://www.youtube.com/embed/fKbGMzYSdB0?rel=0" height="315" width="420" allowfullscreen="" frameborder="0"></iframe></div>

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Is this what you are doing? http://codex.wordpress.org/Embeds

    Are you switching between the Visual and Text editors? That causes problems.

  3. DanPWhalen
    Member
    Posted 1 year ago #

    Well its not what I was doing, but maybe that could work. Not sure, never done auto embed before. Can I align an auto-embedded video?

    And no, I was dropping that code line into the text editor

  4. DanPWhalen
    Member
    Posted 1 year ago #

    Take a look at this:
    https://www.dropbox.com/s/b19fn4qzwuf7uu6/problem.png

    when i put in the above code into the post in text, and then flip to visual, this is the preview i get. its perfect, the yellow box is exactly where i want the video to be and its the right size and everything.

    However when i hit update and actually go to my webpage, the video disappears

  5. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Like I said, don't switch between editors - it causes problems.

  6. DanPWhalen
    Member
    Posted 1 year ago #

    Not sure I get it man. I have to place that bit of code in text because its code. When I hit "Update" and go to the actual page theres NO video. Same problem whether or not I look at visual or not.

    There's gotta be something wrong with the code. Do I need to throw in video-container" class in there somehow or something? again the code I'm using is

    <div style="float: right;"><iframe src="http://www.youtube.com/embed/fKbGMzYSdB0?rel=0" height="315" width="420" allowfullscreen="" frameborder="0"></iframe></div>

  7. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You only need to paste the YouTube URL for the video you want - no iframe. On the YouTube page of the video, just copy that URL.

    <div style="float: right;">
    URL here
    </div>

    WordPress does the hard stuff for you :).

  8. DanPWhalen
    Member
    Posted 1 year ago #

    Thanks for all the help, but still no soap. I just see the URL overthere, not the vid

    Take a look if you want
    http://askitonlinesurveys.com/how/

    or heres a screenshot:
    https://www.dropbox.com/s/rwajiqc0tp4cum1/Untitled.jpg

  9. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Can you post a link to the YouTube video you want to use? Then I can try it on a test site.

  10. DanPWhalen
    Member
    Posted 1 year ago #

  11. DanPWhalen
    Member
    Posted 1 year ago #

  12. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Okay, worked without a hitch! So that means something else must be going on, but let's just try this once more. Make a new post and in the TEXT editor, copy this to it

    <div id="myvid">
    https://www.youtube.com/watch?v=fKbGMzYSdB0
    </div>

    Update the page and see what you get.

  13. DanPWhalen
    Member
    Posted 1 year ago #

    Yeah that worked. Now how can I toss that into the existing page (without it taking up the whole page)?

    When I drop that code into the page in question, it looks like this: http://askitonlinesurveys.com/how/

  14. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    YAY! So since we put it inside the div, we can use that id to add CSS to set the width you want - try this:

    #myvid {
       width: 500px;
    }

    Adjust to whatever you want.

  15. DanPWhalen
    Member
    Posted 1 year ago #

    FOR THE WIN!!!

    That totally worked! thank you so much!!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic