WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cannot force line breaks in post! (27 posts)

  1. themandril
    Member
    Posted 8 years ago #

    I want to add line breaks here and there in my posts. I have tried everything. I thought I could just enter:
     
    and that would create an unbreakable line. It looks good in preview, but once saved, WP strips out all such breaks.

    Can anyone tell me how to add a line break in a post and have it stay there?

  2. Press enter?

  3. vkaryl
    Member
    Posted 8 years ago #

    Alternatively, try adding <br /> where you want the line to break. If you need more space, try two of those. Or add a <p> tagset.

  4. moshu
    Member
    Posted 8 years ago #

    Hitting the Enter twice it does add a <p> tag - as far as I know. And pressing it once = <br />

    I really don't understand the OP question.

  5. themandril
    Member
    Posted 8 years ago #

    This is a new install, right out of the box at Yahoo with their new Yahoo Business/Wordpress installation option.

    When I am creating a post, if I enter blank lines, enter
    tags, or if I enter  , regardless, when I save the post WordPress strips out all blank lines and publishes it without them. It completely removes them. I have tried everything and it simply won't allow blank lines in my post. It's driving me crazy.

  6. moshu
    Member
    Posted 8 years ago #

    Never trust Yahoo.
    It had problems with WP before and I don't think they are able to do it right now. (but this is just my personal opinion!)
    Get a cheaper host and install it manually - it will work.

  7. themandril
    Member
    Posted 8 years ago #

    Unfortunately, I have all of my hosting set up at Yahoo already. I must say, it is awesome, great uptime, everything is tidy and easy to manage. I did use their new MT installation and found that I HATE MT, but now that they are the new WP host with quick install and everything, I had some confidence. Other than this issue of not being able to put line breaks in my posts, it works perfectly, and fast!

  8. moshu
    Member
    Posted 8 years ago #

    Well, that's not perfect... and I suggest you ask them about this thing since it works everywhere else, except your "perfect" Y.

  9. themandril
    Member
    Posted 8 years ago #

    Fixed. In case anyone else has the same problem, here's the deal:

    The Tiny MCE editor WP has incorporated (which I love) is defaulted to remove/clean up line breaks and stuff. If you use shift-enter instead of enter you should be in luck. Depending on your configuration, you might also have to edit the initialization settings in the js/tinymce/tiny_mce.js file and change these values to reflect:
    this.defParam("force_br_newlines", true);
    this.defParam("force_p_newlines", false);
    this.defParam("convert_newlines_to_brs", true);

    That's what did it for me anyway...

  10. themandril
    Member
    Posted 8 years ago #

    Oh, forgot this obvious change as well:

    this.defParam("remove_linebreaks", false);

  11. themandril
    Member
    Posted 8 years ago #

    One last piece of advice for other newbies like me, shift-return works like a charm compared to plain old return in the WYSIWYG editor...

  12. ryanm527
    Member
    Posted 8 years ago #

    Hi - I am trying to do the same thing. I need to add multiple line breaks, and WP appears to be stripping them out or ignoring them for some reason.

    I do not know what the tiny MCE editor is, I am not seeing that file anywhere in my installation, so I can't make those changes you found. Using the shift-enter had no effect as well... Any other way to get it to let me add more space in my page?

  13. moshu
    Member
    Posted 8 years ago #

    Well, the OP never said till the end he's using WP 2.0. That's the one coming with the wysiwyg editor (a.k.a. tinyMCE).

    As far as I remember in 1.5.x that's how it works: you cannot have more blank lines.

  14. kmdtkh
    Member
    Posted 8 years ago #

    themandril: YOU RULE!!!!

    I was starting to f%^$^%king hate tinyMCE for cleaning up < br >. I now still have a center problem, sometimes it just does not center. The first pic it will but the second it refuses!

  15. Jarris
    Member
    Posted 8 years ago #

    FYI this is where that file is that u edit

    wordpress/wp-includes/js/tinymce

  16. Jarris
    Member
    Posted 8 years ago #

    it also strips &nbsp from my posts when i enter them in html. How do i get it to stop removing them? Basically I'm trying to figure out how to tab in the first line...

  17. FurrTrap
    Member
    Posted 8 years ago #

    jarris: best done in your style.css, where you can adjust how the first line of paragraphs will be displayed.

  18. Jarris
    Member
    Posted 8 years ago #

    Thx fur, i just finally figured that out my self. FYI You go into:
    presentation-> Theme Editor -> Stylesheet
    and insert this guy

    p {
    text-indent: 1em;
    }

    that will indent everything in a P tag. I was happy with this until I realized it automatically adds a P tag even when you don't hit return (in rich text) and will put it back if you remove it from the html. I can't figure out how to do get them not to auto-add. What would be best is if i could simply select an option to allow the HTML editing to overwrite :-(

  19. Ciryaquen
    Member
    Posted 8 years ago #

    Excuse me, but I use a Mac. Is there some other way to force a new line besides "shift-enter"? Isn't that some sort of PC thing? Even using Safari my line breaks are stripped.

    It's making me nuts. Also, I found the tiny_mce.js file but can't figure out what from the following to change.

    Depending on your configuration, you might also have to edit the initialization settings in the js/tinymce/tiny_mce.js file and change these values to reflect:
    this.defParam("force_br_newlines", true);
    this.defParam("force_p_newlines", false);
    this.defParam("convert_newlines_to_brs", true);

    [snip]

    this.defParam("remove_linebreaks", false);'

    Can someone please explain this?

  20. spiffae
    Member
    Posted 7 years ago #

    I am having more trouble - I tried those edits in the .js file, and I'm still having the same exact behavior! Even though the trues and falses are set correctly, it still parses everything into a P. Do I have to set some sort of read-only or change something else?

  21. Torley
    Member
    Posted 7 years ago #

    I'm wondering about this too. I'd like to use multiple line breaks as well, and not being able to do it as described here is problematic. Any advice graciously appreciated, thanxies!

  22. Torley
    Member
    Posted 7 years ago #

    I ended up disabling the richtext editor and inserting in:

     <br><br>

    for extra lines.

    It won't work with the richtext editor on.

  23. Torley
    Member
    Posted 7 years ago #

    Oh rats, it removed my "& n b s p ;" (remove spaces).

  24. spiffae
    Member
    Posted 7 years ago #

    yeah, it removes everything. does anyone know how to tell the MCE to not reformat linebreaks? there must be some way to tell it to just replace line breaks with a non breaking space?

  25. mysterylizard
    Member
    Posted 7 years ago #

    themandril, thanks!
    I've been tearing my hair out over the editor stripping out <p> tags and generally screwing up all the breaks when i hit save.

    Got it sorted now, so cheers mate :)

  26. pgoiffon
    Member
    Posted 7 years ago #

    I was facing exactly the same problem, and modifying the tiny_mce.js file had absolutly no effect. It was really strange because I could see the
    in the wysiwyg editor html view even after saving a post, but when opening the post in my blog the
    were just gone !!

    Indeed we used Wordress 1.* for quite a long time on this blog, and so we used a lot the markdown syntax. So seeing that the Markdown plugin wasn't bundled anymore with WordPress 2.0, I just tried to desactive the plugin and... Eureka, my
    then came in the source as expected !

    I then saw a post indicating the Markdown plugin wasn't compatible with the tinyMCE editor : <http://www.michelf.com/weblog/2005/markdown-and-wordpress-2.0/>

    Hope this could help some users who have the same problem...

  27. GMT
    Member
    Posted 7 years ago #

    I'm fairly new to wordpress and experiencing the same difficulties with my editor automatically removing line breaks or paragraphs. I changed the Tiny MCE settings as suggested above but the changes had no effect on the editor. Like others everything looks good until I save the updates. Working in HTML doesn't improve things.

    I am using a Mac, Firefox, and WP 2.0.5. Could this be a result of using a custom theme? Where might I look on within the theme's files to make the changes that would allow manual entry of additional line breaks?

    FYI I have never knowingly used Markdown and I don't have a Markdown plugin.

    Any help appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags