WordPress.org

Ready to get started?Download WordPress

Forums

Embedded objects disappear (6 posts)

  1. toasterman
    Member
    Posted 3 years ago #

    I have had this problem for several versions now, that embedding objects does not work properly.
    If I embed a Google Map, for example - I know from reading online that I must do this in the HTML editor. Switch to HTML editor, save draft, preview post and the map is there. Switch to Visual mode to continue editing, and it is still there.
    However, add another Google Map in the same way - switch to HTML, add, back to visual, and the first map disappears. If I switch back the HTML viewer, some code remains, but it doesn't work.
    Instead of seeing the map, I just get the link to "view larger".

    YouTube video is similar. I'm typing a post, want to add a video with YouTube's embed code, so I go to HTML, paste in YouTube's video code, then go back to Visual to continue my post. The video is there, and visible. As soon as I switch to HTML view to add something else though, my earlier video disappears and is replaced by simply one nbsp in the HTML code.

    In fact I've just discovered the point at which it disappears.
    It's when I go back to the HTML view.
    Visual->HTML is fine, when I add the code.
    I can go back to Visual fine.
    When I go back to HTML again, my embedded YouTube video code is gone.

    Must I type the entire text first, then add all the videos, maps, etc. in HTML mode at once? That's not generally the way I work, as I'll come up with ideas half way through a post. Plus as I can't copy/paste from notepad into WordPress, without it misinterpreting all my line returns, I'm forced to write it directly into the editor.
    What if I need to modify it at a later date? Can I never go to visual mode, if I might want to return to HTML again?
    I'm sure this used to work flawlessly switching back and forth, but now it borks anything I've embedded.

    I am using the Nature_wdl 1.3 theme, and have no plugins related to embedding or graphics/video viewing - just things for anti-spam, and mobile themes (WpTouch).
    I have just logged into another WordPress install with a different theme, running WordPress 3.0.1 and I have the same problem.

    Any help much appreciated.

  2. toasterman
    Member
    Posted 3 years ago #

    Have done a bit more testing (big thanks to a friend of mine) and discovered that both Google Maps and YouTube embeds use iframes.
    Something like Vimeo's old-style embedding (as their new style uses iframes) works flawlessly, flicking back and forth between editors.
    I wasn't aware that WordPress doesn't like iframes.

  3. Phil
    Member
    Posted 3 years ago #

    You can also embed youtube through the 'Old embed type', which isn't iframes. it uses the <object> tag, and I never have issues in WordPress with it.

    You choose this in Youtube, once clicked 'share', you'll see an option to choose the old method.

  4. toasterman
    Member
    Posted 3 years ago #

    "Use old embed code". It's right there on YouTube's site. Jeez. Couldn't see that for looking. Thanks a lot.

    There isn't that option on Google Maps, but I've already found a workaround for that - do a screenshot of the map, upload the picture, and link it to Google with their "email or IM" link.

  5. Phil
    Member
    Posted 3 years ago #

    No problem.

    yeah, Google maps is the only one that has to be iframed in.

    Problem with your method is you don't get the interactivity (zoom, directions etc) on the page with just an image.

    it is very annyoing, so I always copy and save the code in a text editor and if it messes up on the site, i just paste it back in. Another way would be to embed the google map in a blank html page and iframe that. That way, you wouldn't lose the content of the iframe as it would be something like:

    <iframe src="googlemap.html width="500px" height="300px">

  6. toasterman
    Member
    Posted 3 years ago #

    Ah. I try to keep it as HTML-less as possible, from a user perspective. I'm quite lazy when it comes to code. If something else will do it for me at slightly reduced functionality, I'll take it.

    Also, I'll forget to copy/paste it into a text editor one day when I'm editing something, and end up losing the code all over again anyway. Not so bad with a normal "contact us" page, but I did a post which included 4-5 maps recently. I did a lot of shouting at WordPress that day.

    Thanks for the tip though.

Topic Closed

This topic has been closed to new replies.

About this Topic