Line Breaks
The WordPress content editor is notorious for eating/munching line breaks. This is because of a combination of WordPress functions which run “behind the scenes” whenever saving content or switching between “text” and “visual” views. WordPress will seek out recurring line breaks, and remove them from the editor.
Try for Yourself
To get an idea of what’s going on; create a new post and name it “Test Post”. Next, insert the following content (into the “text” view):
This is my first sentence. <br /> <br /> <br /> Here is another sentence.
Now, switch between “visual” and “text” views; or simply save the content. You will notice the break tags have disappeared; and the spacing where the break tags existed before has been reduced.
Using the Shortcode
To get around this; WP Edit Pro has created a shortcode which can be used instead. Since WordPress sees this as a shortcode; it has no idea it is really a line break, sneaking it’s way into the content editor.
We use the [break] shortcode whenever we need to insert a line break.
This is my first sentence. [break] [break] [break] Here is another sentence.
Now the editor will preserve our shortcode whenever saving or switching views. Then, when our content is viewed from the front end of the website; the shortcode will render as a line break in the html code that is output.
the <pre></pre> set of tags seems to work when placed in the html// at the point where you want the line break. at least it is working right now. I am using the DIVI theme from Elegant Themes.
Hello,
Thanks for the feedback. Please let me know if you have any suggestions to make it better.