• I am in the process of creating a new post and I am embedding videos and other links into the post. For some reason, all of a sudden, every time I add the codes they disappear right after I add them. If I add them and then save the post, the codes are gone. Can someone please help me. I am trying to get my post out soon.

Viewing 15 replies - 31 through 45 (of 69 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Yes, if you go back to edit and it goes into the Visual editor, then the code will indeed disappear.

    If you don’t want to use the visual editor, disable it. You can do this on your Users->Your profile page.

    Thread Starter Alexis403

    (@alexis403)

    I think you are misunderstanding the problem. I use the visual editor more than I use the HTML editor, so there would be no reason for me to disable it. The problem is, codes with iframe tags are the only ones that will constantly disappear. It becomes very annoying when I constantly update a page that has a code with iframe tags in it. I have to repeatedly add that code back in while I’m updating other important information. All other codes stay in place, the iframe codes are the only ones that disappear.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Yes, I fully understand the problem.

    What I’m telling you is use the Visual editor or don’t. Pick one, basically. Switching back and forth will cause the problem you are experiencing.

    Forgive me Otto – but your argument is a bandaid. The power of WordPress is the ability to use the html and the wysiwyg visual editor. To say, just don’t use the visual editor because wordpress is broken is like saying to someone with a broken leg – just don’t walk.

    This is a wordpress design flaw and as such WORDPRESS DESIGNERS should fix it.

    I too use the visual editor more than the html editor. I’m not a coder – that’s why I USE wordpress….

    This is clearly a problem – it needs to be fixed – wordpress – you guys listening?

    Thread Starter Alexis403

    (@alexis403)

    Thank you CoachDebra, my sentiments exactly. I chose not to respond to Otto because he obviously just doesn’t get it, or chooses not to. I prefer using the visual editor as well, but let’s say I took his advice and only used HTML. Every time I have to update my page, the codes would STILL disappear, whether I staid in HTML or not. The simple fact of going back into the page after posting it will make the iframe codes disappear and THAT needs to be fixed, period.

    All of these people responding to this problem should prove that this issue needs some serious attention.

    For now, put the disappearing code in LAST. Using HTML mode. And if you think you might go back later to edit it, save the code snippet in a text file on your computer somewhere.
    Wordpress has always had problems with removing or changing some things with the visual editor, don’t hold your breathe waiting for a fix.

    I think the solution maybe via a plug-in. I haven’t found one that works for me yet. Most of them seem a bit complicated. If anyone finds a good one that solves this problem of code disappearing, let me know.

    In the previous form of my website, I used a custom field to contain the iframe and that maintained it through editing. However, I use wishlist now and the custom field doesn’t support the codes to hide the content from non-members.

    So, you may find a custom field solves the issue for you. But it’s still an issue for me.

    There is a solution to the problem, but it will involve adding code to your Theme’s functions.php file – code that modifies the configuration of the TinyMCE editor, to prevent it from removing the HTML tags that you need to use.

    For example:

    Caution: use at your own risk.

    function mytheme_tinymce_config( $init ) {
    
    // Add IFRAME to list of valid HTML elements (so they don't get stripped)
    
    	// IFRAME
    	$valid_iframe = 'iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]';
    
    	// Add to extended_valid_elements if it alreay exists
    	if ( isset( $init['extended_valid_elements'] ) ) {
    		$init['extended_valid_elements'] .= ',' . $valid_iframe;
    	} else {
    		$init['extended_valid_elements'] = $valid_iframe;
    	}
    
    // Pass $init back to WordPress
    	return $init;
    }
    add_filter('tiny_mce_before_init', 'mytheme_tinymce_config');

    Thread Starter Alexis403

    (@alexis403)

    Thanks Chip. I will try it to see if it works.

    hey folks – I’m at SXSW – and just met a developer that says he has a plugin solution for this – but couldn’t find it at that instant. I’ll follow up with him after the conference and share what I learn.

    Warm regards,
    Debra

    Thread Starter Alexis403

    (@alexis403)

    Thanks! I’m looking forward to it. That would be a much easier solution. I really appreciate everyone’s help. ??

    OK folks! I return from SXSW with an answer to this problem! I stopped at the Exhibit WordPress Genius Bar and worked with 2 people there to solve this issue.

    First, what exactly is happening. It seems that there is both a bug and a feature that is causing this issue. It is basically a misunderstanding in how the visual reader is reading the html code. So, it’s all in the wysiwyg viewer interface with the html viewer.

    The result is that the wysiwyg viewer deletes code it doesn’t know how to show.

    But there is a solution:
    Install the plugin “Easy iFrame Loader” and activate it.

    Now, there seems to be some complicated formatting that it’s asking you to do. I use AudioAcrobat and they do all the formatting on their end. And, frankly I don’t know html or code, so didn’t want to touch that.

    I was advised to replace 2 pieces of their code as follows:
    1) at the beginning of the string:
    <iframe
    Is replaced with
    [iframe_loader

    2) At the end of the string:
    ></iframe>
    is replaced with
    ]

    Very simple. It works and conserves the formatting done for me.

    HTH
    Debra

    Thread Starter Alexis403

    (@alexis403)

    Thanks so much Debra, I will be trying this soon.

    Alexis403 – As long as you have validation errors like this, https://validator.w3.org/check?verbose=1&uri=http%3a%2f%2fwww.findinghopewithin.com%2f your site will never function perfectly with all browsers.

    coachdebra – You might want to validate your site also. I did not have a url to do so.

Viewing 15 replies - 31 through 45 (of 69 total)
  • The topic ‘My codes keep disappearing’ is closed to new replies.