How To Add A Line Break In WordPress

add a line break

Are you searching for a way to add extra spacing using line break to your WordPress post? You can add a line break using tag ‘<br/>’ via the text editor. However, inserting more than one, lines get stripped. 

So what’s the solution? You can easily solve this problem without struggling. All you have to do is follow the instruction that I have given below.

Then you will be able to insert any size line break into your post. Why wait then? 

Let’s begin. 

How To Add A Line Break In WordPress Posts (Block Editor)

In WordPress’s default editor, you can easily insert a line break by pressing the ‘Shift + Enter’ button. If you want a bigger line break, then you can insert it using a Spacer block. 

First, click on the ‘Add block’ button and search for ‘Spacer.’

Click on the ‘Spacer’ element to add it to your post. Now adjust the size of the line break by Clicking on the blue dot.

You can adjust the line break size any pixel you want. 

Adding A Line Break In WordPress Classic Editor

You can also insert a line break by pressing the ‘Shift + Enter’ button. This will push your text to the next line. However, if you want a bigger line break, you have to use inline CSS. 

First, click on the ‘text tab,’ then find the paragraph below to add a bigger line break. Now add the tags (the <p> at the beginning, and </p> and the end). 

Add a bottom margin in your paragraph. 

Example: <p style=”margin-bottom: 200px;”>This is a paragraph I want to add a 200 pixel gap after.</p>

On the above line, just change the pixel size according to your preference. 

Adding Line Break With Shortcode

First, you have to edit your themes ‘functions.php’ file to add a line break with a shortcode. Go to Appearance -> Theme Editor. Now click on Theme Functions. 

Now copy the following code and paste it here. 

/* ------- Line Break Shortcode --------*/
function line_break_shortcode() {
	return '<br />';
}
add_shortcode( 'br', 'line_break_shortcode' );

Don’t forget to update the file. Now code has been added to your functions.php file. To add a line break, all you have to do is insert the shortcode in your visual editor. 

[br]

An example:

I am a text. 
[br]
I am a text with a line break.
[br][br]
I am a text with two line breaks. 

Which will display like:

I am a text. 


I am a text with a line break.

I am a text with two line breaks. 

Final Words

I hope this helps you to add a line break in the way you want. If you have any question, don’t hesitate to ask them. Leave your question in the comment section below, and I will be happy to answer them. To checkout more similar guides, visit here.

Leave a Comment

Your email address will not be published. Required fields are marked *

Copy link
Powered by Social Snap