7
votes

This should be very simple, i can not believe that a company the size of Wordpress cannot provide users a very simple way to make line breaks.

I know how to use the text tab and code the page using html (im a developer). However my clients have absolutely no idea what html is so they obviously can not use it.

All the client wants to do is make a "space between lines" , in our terms a break line. They only want to use the visual editor.

Now when they start typing and hit enter, it creates & nbsp; or closes a paragraph tag.

Many articles are saying that shift + enter will make one, however this 100% does not as ive tried.

Ive tried a plugin that most articles are suggesting called "tinymce advanced". But this does not resolve the problem.

Is there any way possible for a normal user with no html knowledge to only use the visual editor and create br lines without actually using code?

4
I'm also facing same problemImran Saleem

4 Answers

1
votes

Holding down Shift+Enter definitely works.

Alternatively, you can always prevent Wordpress from automatically adding <p> tags to the markup using the following code inside of your theme's functions.php file:

remove_filter('the_content', 'wpautop');
0
votes

I had this problem on my site, it began when I updated the theme, which had not been updated for years. The "miraculous" solution was to update all the plugins as well.

I have realized that the

<br / > and the < p >

symbols are not present in the wp editor in text mode So there must be a conversion between \n (newline) and <br / > and < p > taking place, I have not investigated this further, but maybe somebody can explain how WordPress is working.

0
votes

With the WordPress upgrade to version 3.2, the text editor seems to remove the line break by itself.

Add a filter in the functions.php file which adds a clear attribute to the <br/> tag. When the attribute is added, the <br/> tag is not removed by WordPress.

function clear_br($content){ 
     return str_replace("<br/>","<br clear='none'/>", $content);
} 
add_filter('the_content','clear_br');

Then apply this filter on a variable where you need break should come in that text content

$specification = apply_filters( 'the_content', $specification );

For more info: https://blog.templatetoaster.com/wordpress-line-break-not-working/

0
votes

This small code fixed my issue.

echo nl2br(category_description( the_content);

Just replace the content tag with this in you file