WordPress.org

Ready to get started?Download WordPress

Forums

HTML code dissapearing! (4 posts)

  1. studiomanifesto
    Member
    Posted 5 years ago #

    I usually use the HTM Editor for creating posts and pages on wordpress. Often, I'll use line breaks in the HTML editor, but when I switch to the Visual Editor, the line breaks disappear. Is there any reason for this?

    I was told to use the <code></code> function for inserting HTML, but it dosen't work. Here's an example of that it looks like in the HTML Editor:

    <h2>Topic 1</h2>
    <p>Blah Blah Blah</p>
    </br>
    <h2>Topic 2</br>

    This works fine on the page during the preview, but once switched to the Visual Editor, and back to the HTML Editor, the breaks are gone.

    Any help or suggestions?

  2. OZtwo
    Member
    Posted 5 years ago #

    yes, this happens a lot. what I do to get around this problem is to change to html view at the end and add your code. Then save the post from there. Else if you go back to the Visual editor, it will be so very nice to auto format for you taking out all the code you just added.

  3. studiomanifesto
    Member
    Posted 5 years ago #

    Fantastic, just glad to know I'm not going crazy. Thanks for the reply.

  4. iridiax
    Member
    Posted 5 years ago #

    Often, I'll use line breaks in the HTML editor, but when I switch to the Visual Editor, the line breaks disappear. Is there any reason for this?

    Yes, switching back and forth between the visual and html editors will mess up your code. Use only one or the other.

    I was told to use the function for inserting HTML...

    You were told wrong unless you want to display the code example in your text.

    BTW, line breaks <br /> can be automatically generated in WordPress by a single enter (return) when typing in your text.

Topic Closed

This topic has been closed to new replies.

About this Topic