{"id":58,"date":"2012-02-03T17:01:26","date_gmt":"2012-02-03T17:01:26","guid":{"rendered":"https:\/\/theextremewebdesigns.com\/blog\/?p=58"},"modified":"2012-02-03T17:01:26","modified_gmt":"2012-02-03T17:01:26","slug":"wordpress-line-break-1-line-solution-without-plugin","status":"publish","type":"post","link":"https:\/\/theextremewebdesigns.com\/blog\/wordpress-line-break-1-line-solution-without-plugin\/","title":{"rendered":"WordPress line break &#8211; 1 line solution without plugin"},"content":{"rendered":"<p>While working with WordPress in Admin Panel, you may have noticed that when you Update\/Save the post once you are done entering the Post, WordPress automatically strips out extra line break \/ paragraph break otherwise commonly known as &#8220;<strong>WordPress line break problem<\/strong>&#8220;. <!--more--><\/p>\n<h2>How to fix line break problem in WordPress<\/h2>\n<p>I personally came across this problem. In this post, I am going to give you a 1 line solution to solve this problem, all without using any plugin!<\/p>\n<p><strong>Let me illustrate the exact problem by means of the following image:<\/strong><\/p>\n<p><a href=\"https:\/\/theextremewebdesigns.com\/blog\/wp-content\/uploads\/2012\/02\/missing_breaks_before.png\" class=\"broken_link\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-60\" title=\"WordPress Line Break missing\" alt=\"WordPress Line Break missing\" src=\"https:\/\/theextremewebdesigns.com\/blog\/wp-content\/uploads\/2012\/02\/missing_breaks_before-295x300.png\" width=\"295\" height=\"300\" \/><\/a><\/p>\n<p>As indicated by the red arrow, there is no spacing between the paragraphs even though I have manually forced multiple line breaks. I searched Google to see if there is any solution for this. I did come across TinyMCE plugin that forces WordPress to retain the breaks as you enter them. But then I thought. Really? I need to install a whole plugin just to solve this tiny problem? I don&#8217;t think so. \u00a0I thought to myself. \u00a0Then I examined the source code of the page to see how WordPress was treating the line breaks and paragraphs and have come up with a 1 line solution for this, without having to install a plugin. This means that you can implement this solution in your blog right away, without installing any plugins. Ready for the solution? Here it is:<\/p>\n<p>In your theme that you are using for the WordPress, add the following style in the style.css\u00a0style-sheet:<\/p>\n<p><a href=\"https:\/\/theextremewebdesigns.com\/blog\/wp-content\/uploads\/2012\/02\/missing_breaks_solution.jpg\" class=\"broken_link\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-61\" title=\"WordPress line break missing Solution\" alt=\"WordPress line break missing Solution\" src=\"https:\/\/theextremewebdesigns.com\/blog\/wp-content\/uploads\/2012\/02\/missing_breaks_solution-300x87.jpg\" width=\"300\" height=\"87\" \/><\/a><\/p>\n<p>Alternately, you may copy the following code directly into the style-sheet:<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"Fix line break problem in WordPress\">p {\nmargin-bottom: 20px !important;\n}<\/pre>\n<p>What this essentially does is adds a margin to every\u00a0paragraph that WordPress adds\/formats. Using <span style=\"color: #ff0000;\"><strong>!important<\/strong><\/span> forces the browsers to obey this rule and apply this rule by overriding any other rules.<\/p>\n<p><strong>Here&#8217;s how it looks like after applying the solution:<\/strong><\/p>\n<p><a href=\"https:\/\/theextremewebdesigns.com\/blog\/wp-content\/uploads\/2012\/02\/missing_breaks_after.png\" class=\"broken_link\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-62\" title=\"WordPress line break missing: Problem Solved!\" alt=\"WordPress line break missing: Problem Solved!\" src=\"https:\/\/theextremewebdesigns.com\/blog\/wp-content\/uploads\/2012\/02\/missing_breaks_after-300x280.png\" width=\"300\" height=\"280\" \/><\/a><\/p>\n<p>As you can see, the spacing between the paragraphs appear making it very neat and tidy. Hope this solution helps out the needy. If you have any questions, please leave a comment below.<\/p>\n<p><strong>Notes:<\/strong><\/p>\n<p>1. There&#8217;s one thing you need to remember. If you enter multiple line breaks, say for example, 5 line breaks between 2 paragraphs and Update the post, if you view the post, you will see all these multiple\u00a0paragraphs intact i.e you will see 5 line breaks. But when you enter some additional text in the post and Update it again, then WordPress will automatically remove all the extra line breaks and will retain only 1 line\/paragraph break. So ideally speaking, there would not be any need for anyone to have 5 line breaks between 2\u00a0paragraphs. The maximum number of line\/paragraph breaks between any two paragraphs, ideally should not exceed more than one for readability purposes. Using the above solution achieves this purpose.<\/p>\n<p>2. If you want, you can adjust the margin-bottom value to any other value other than 20px, as you see fit.<\/p>\n<p><strong>That&#8217;s it!<\/strong><\/p>\n<p>Do you have any suggestions to <em><strong>fix line break problem in WordPress<\/strong><\/em>? Feel free to suggest by commenting below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While working with WordPress in Admin Panel, you may have noticed that when you Update\/Save the post once you are done entering the Post, WordPress automatically strips out extra line break \/ paragraph break otherwise commonly known as &#8220;WordPress line break problem&#8220;.<\/p>\n","protected":false},"author":1,"featured_media":114,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13],"tags":[29],"class_list":["post-58","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips-and-tricks","tag-tips-tricks"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paBnQX-W","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":0,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}