Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

So I have a problem when making a post. If I press enter and make a new line in the editor and press safe the line break diapers. But when I show the post it have inserted a line break. So somehow the editor is not able to show the line break? If I save the editor again the line break disappears from the post as well.

Any ideas?

I read in a post to try and use:

remove_filter ('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');

Which I did and now line breaks don't work at all. I have build a custom page where the posts are shown with the

echo the_content();
share|improve this question

closed as too localized by EAMann Jul 19 '12 at 19:14

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

2 Answers 2

You've stumbled across a 'hidden' feature of WordPress and TinyMCE (the visual editor) it has a problem with line breaks and strips them out.

Try either of these two plugins: http://wordpress.org/extend/plugins/line-break-shortcode/ http://wordpress.org/extend/plugins/simple-breaks/

share|improve this answer
    
There is no way to handle this in any other way? Like editing the code for the editor and put like a nl2br() around the content? –  Ronnie Jespersen Jul 15 '12 at 21:43
1  
there are comments on WordPress.org about this - but it's not a good idea to hack the core code of WordPress. You could break your WP install & your hack would be deleted next time you try to update to a new version. –  Damien Jul 15 '12 at 21:49
    
That is so true Damien... I am just very frustrated about this simple issue :) –  Ronnie Jespersen Jul 15 '12 at 21:57
    
It's actually a 'good' feature which prevents users from adding unsafe HTML code via Tiny MCE and its from an assumption that people pressing Enter key want a paragraph break. –  Damien Jul 15 '12 at 22:02
    
did you try this ... codex.wordpress.org/Function_Reference/wpautop –  Damien Jul 15 '12 at 22:03
show 3 more comments
up vote 0 down vote accepted

Ah sorry I just realized that I had margin: 0 on all elements to reset all defaults in browsers... this caused the issue!

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.