Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. I think that I must use regex, but I didn't find the right expression. People who code: we want your input. Take the Survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Save their lives
It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. I'm not sure if is wordpress itself or Tiny MCE that's doing it. I don't even have a line break in the code, it seems to somehow be deciding where it wants to place them based on the tags in my html code. Are you copying and pasting your code from an external editor? I found that non-breaking spaces are being inserted when I use two spaces after a period.
View in Your Language
A non-breaking space allows you to add a space between two words that prevents an automatic line break line wrap at its position. I followed your guide and it works perfectly, thank you so much! Now sometimes I need a thin non-breakable space French typographic rules. If so, would it be the same as the one above with instead of nbsp? Thanks if you can help! Thanks for letting me know. I suspect i was skipping step 10, I tend to work in the text editor a lot. It turns out you need to add a function to customise how the visual editor TinyMCE is used by default in WordPress handles non-breaking spaces. It will retain the codes.
So, what exactly happens in the text area field of a meta box when you make a new line and save? These new lines are saved in the database and you can see that there is nothing wrong in the output at editor view in the back-end. Here is an example code:. The CSS way: Yes, this is my favorite way. One thing to mention here — the second method does not work properly for Internet Explorer versions prior to 8. So, there you go. Two easy ways of outputting line breaks from WordPress meta box text area field. Like Like.