• Hello,

    when i use text editor in WP, i have two options :

    • or i stop adding automatic <p> and <br> tags,
    • or the opposit, it gives those tags automatically.

    I get crazy by that like other millions of people on the web… i would like to work as on a normal html page : when i push “enter”, it gives an empty line as we see it on the screen and when we add a code, it gives a the code which behaves like a code.

    Now, for example, if i do this in the text :

    this is a sample sentences <h2>here i want two words with h2 style</h2> here my sentence continues...

    but in the reality it gives a result like this :

    <p>this is a sample sentences <br />
    <h2>here i want two words with h2 style</h2><br />
    here my sentence continues...</p>

    I understood and i tried to remove automatisation with adding remove_filter (‘the_content’, ‘wpautop’); to the functions file but in this case at each line break i must add a code which is crazy.

    Is there a solution ???

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Could you provide another example? You shouldn’t be putting a “<h2>” inside a “<p>” and so in that example WordPress is doing its job in keeping up semantics.

    Thread Starter igorlaszlo

    (@igorlaszlo)

    Thanks for your interest Andrew…

    I never gave the <p> to the sentence. You mean that we never can give <h> tag in a sentence ?
    Anyway, it is not a big problem because i can give another style to my words, for example <span>

    But what i would like, it is a behaviour like in a normal html page. In an html page edited in Dreamweaver or in block note, when i break a line, it does automatically without seeing any <br> or &nbsp or <p> on the page but it breaks the line.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    So DreamWeaver breaks the line visually and then only when the page has been saved/ submitted does it insert the “<br />” HTML instead of when you switch to the “text” editor (equivalent)?

    Thread Starter igorlaszlo

    (@igorlaszlo)

    I guess… did you ever use block note or any text editor ? When you push “enter”, it breaks the line as you see it plain but you do not see any code… but if you give a <br> or <p> code, the codes work too…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to use text editor as html’ is closed to new replies.