Sometimes, while writing your articles, you need to add space to better highlight certain elements. It can be an image or advertising information.

WordPress offers a built-in feature that allows you to add space in your posts. In most cases, this feature works, but when it doesn't with your theme, what to do?

When to add a separator line in an article

You may want to highlight an item in an article, or your theme may not display correctly the images that follow a paragraph (text may be embedded below the image).

Some may also want to add a line to spruce up the layout. In this tutorial, I will show you how to add a separator line in your paragraphs on WordPress.

How to add a separator line with a WordPress plugin

Before discussing this method, I must first remind you how this is possible with the (Horizontal Line) button by default on WordPress.

WordPress horizontal line

Once you click on this button, it will show a line on the area of contents of the visual editor. You can also use the plugin “ Separate Shortcode and Widget ", Available on WordPress.org.

Learn how to install a WordPress plugin.

Separate shortcode and widget

This plugin offers a fairly simple solution that allows you to separate from contents (or widgets) using a shortcode.

How to separate content with manual code

If you are a developer and want to find the code that allows you to separate paragraphs from your articles on WordPress, then you are in the right place.

Remember, before making any changes to the code, you should always consider making a backup of your WordPress blog (if you have not created a test environment).

We have also shown you how to create a plugin. You can use this plugin to save your code. So all you have to do is add the following code:

add_shortcode ( 'diviseur', 'shortcode_insert_divider');
fonction shortcode_insert_divider () {
    return '<div class = "diviseur"> </ div>';
}

The previous code will allow you to create a shortcode on WordPress.

You can also link a CSS file to your WordPress file queue. This CSS code, you will customize it as you wish. The shortcode that you can use to display a space bar is

[Divider]

By using the code, you will be able to create a WordPress shortcode that accepts parameters, so you can easily go through a set parameters to set the height and style of the spacebar.

That's about all there was to know. I hope you can manage to create a space bar on your WordPress blog.