WordPress.org

Forums

embed code disappears in visual (2 posts)

  1. AirtimeJeff
    Member
    Posted 3 years ago #

    There were other topics on this. When I embed a image or video, the script disappears whenever you switch to visual. If I stay in html and update the page, it works fine. Thee issue I have is if I return to the page and then go to visual to work on some other part of the page, bang, the embedded code disappears.

    The code I am embedding is :

    <div id="sv_6296" style="width: 200px; height: 200px;">Flight Planning at SkyVector.com</div><script src="http://skyvector.com/perl/lchart?ll=37.618965823301586,-122.37487023004412&s=3&c=sv_6296&i=127" type="text/javascript"></script>

    If at any time during a page update I jump to visual, the script portion of this code

    <script src="http://skyvector.com/perl/lchart?ll=37.618965823301586,-122.37487023004412&s=3&c=sv_6296&i=127" type="text/javascript"></script>
    is removed by wordpress. I get that I should stay in html mode to originally place this, what I need to know is how to not have to replace this every dang time I go back to update or change the page.

    This is so annoying. I love wordpress, but this one issue makes no sense to me.

    Can anyone tell me if there is a plugin or any way to tweak this issue out?

    Jeff

  2. When I embed a image or video, the script disappears whenever you switch to visual.

    Yes. If you use the Visual Editor it will almost all of the time mung any inserted by hand HTML code. It does that, it's just not meant for hand coded HTML like that.

    The HTML tab is for making small HTML adjustments but insert a div or script like that and well, you know what happens.
    It's the Visual Editor that's giving you grief. If you keep using it for inserting raw HTML (even using the HTML tab) then you'll keep getting frustrated.

    Copying from an earlier response:

    That editor is good for something like 99% of the user base but it will mung any HTML that you try to insert by hand. The HTML tab really is for making small adjustments.

    You can disable it for your account on your WordPress installation.

    http://your-wordpress-url-here/wp-admin/profile.php

    Check on 'Disable the visual editor when writing'.

    Or you can insert that HTML code via a shortcode but you'll need to write the PHP that functionality into a plugin or your theme's functions.php file.

    http://codex.wordpress.org/Shortcode_API

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.