Wordpress removes empty lines between paragraphs. Paragraphs supposed to have an empty line so it will be easy to read by the web site vistor and looks neat. But you have to live with that restriction if you want to stay with Wordpress.

What are line breaks?

Line breaks are what we get when we press ‘Shift+Enter’ on keyboard in WYSIWYG editor. So text will start in new line just below the previous line.

Example:

Line1
Line2
Line3

What are paragraphs?

Line breaks are what we get when we press ‘Enter’ once on keyboard in WYSIWYG editor. So text will start in new line after leaving an empty line.

Example:

Line1

Line2

Line3

How to fix this in Wordpress?

Remember … Wordpress DON’T REMOVE <p … /p> tags as such. It ONLY REMOVES the empty lines in between them. So we use this to fix our problem with paragraphs.

1. Login into your WP admin panel.

2. Go to Appearance > Editor > You will see style.css file in the file list on right side.

3. Locate <p> tag in your css file.

Add the following lines to it:

padding-top:1.0em;
padding-bottom:1.0em;

Example:

My p tag is like this:

.post p {
line-height: 1.5em;
margin: 0px 0px 7px 0px;
}

After adding those two lines, it will look like this:

.post p {
line-height: 1.5em;
margin: 0px 0px 7px 0px;
padding-top:1.0em;
padding-bottom:1.0em;
}

Save the file. That is it!

So all paragraphs get a space above and below but shift+enter leaves us with simple line break as we want.

NOTE:

Some times it is difficult to fine ‘p’ tag or you don’t want to change your css. Then add this at the end of your css file and save:

p {
padding-top:1.0em;
padding-bottom:1.0em;
}

Author: Radhika (c)
http://www.webmasters-central.com/




Related Posts

  • No Related Posts Found