Line Break Not Working in WordPress

Recently i switched my wordpress theme and faced some problems with line breaks.

I searched about it over the wordpress forum and discovered many other related problems as well.

So in this post i will cover all those problems in detail.

#1 – CSS Problem

Check the image below. The first case is where everything is alright and Line breaks are working.

In the second case the line breaks are failing. You can see that in second case there is no space between two html paragraphs (<p> and </p> tags).

line-breaks-in-wordpress-posts

This is because of your theme style. All you need to do is add margin-bottom: 15px; to your post paragraph. If you have basic knowledge of CSS then all you need to do is add bottom 15px margin to the p tag of post-area class or entry class. Since most themes use entry class for the main content.

Now for those who don’t know CSS – Follow the instructions given below.

  • 1) Goto any of your wordpress post.
  • 2) Select some text from the post.

inspect-element-of-single-p

  • 3) Right click and click on inspect element.
  • 4) A pop up will appear at the bottom of your browser as shown below.

entry-p-linebreak

  • 5) As you can see my <p> tag is inside the division having class entry.
  • 6) Also the p tag has margin-top: 0px and margin-bottom: 15px
  • 7) But if you are facing a line break problem then you wont see margin-bottom: 15px
  • 8) If that’s the case then you need to edit style.css of your theme.
  • 9) Goto Admin dashboard > Click Apperance > Click Editor. Style.css file shows up.
  • 10) Add the following code at the very end of the file:

.entry p {

margin-bottom: 15px;

}

Note that i am using .entry because my <p> tag is inside division with a class named entry. Most themes use the same class, But if your theme is using a different one then replace .entry with the respective class of your theme. If you can’t find it, I can help you find it, just leave a comment on this post.

  • 11) Then save the file.
  • 12) Goto your post, Now the changes must take effect.

#2 – Autop() Problem

If all your text is coming in one single line even though you have added line breaks to your post then this is a Autop() related problem. Autop() is a function in wordpress which auto formats paragraphs. This is handy for those who don’t want to manually code every post.

All your text is displayed in one single line and the line breaks are ignored because autop() is turned off. And since its turned off automatic formatting of paragraphs is disabled and you will have to manually edit and add line breaks using <br/> tags.

Autop() is by default enabled in WordPress. If its off for your particular site then this must be due to a plugin or theme issue. Check if autop() is turned off in your theme options or in any plugin options. And if it is turned off then turn it on to fix this problem.

autop-disabledIf you want to know how to disable autop, Check out this post by David Walsh. And if you have any questions, feel free to comment below. I will try and help you out as soon as possible. Thanks for reading.

How To Remove carolini.net Redirect in WordPress

About the problem – If you click on any links on your site randomly for about 5-6 times, you might get redirected to someplace else like carolini.net. This problem is due to a malicious script installed in your wordpress theme.

This can happen if you are using a pirated version of the theme. Or if someone has hacked into your wordpress site. But don’t worry, it can be solved.

All you need to do is locate the malicious script and remove it.

This script is most likely to be found in header.php of your current active theme.

How to access header.php ?

  1. Login to your WordPress admin dashboard
  2. Click on Appearance.
  3. Click on Editor.
  4. See the right hand side bar. You will find header.php there.
  5. If its not available (that’s a rare case), then you will have to manually access header.php via FTP client.

Now once you open header.php. Copy the code given below –

Then go back to header.php and use CTRL+F to find this code inside header.php. If you find it in the header.php then remove that code from the file and save the file.

This should solve the problem. If you have any questions or if any step is not clear, feel free to comment below. I will reply as soon as possible.

How To Add Feedburner Subscribe Box to WordPress

Difficulty Level: Easy

I have shown how to create a feed burner account as well as how to activate email subscriptions for feedburner in my previous post.

If you remember, In the end we had received a subscribe box code.

In this post we are going to use that particular code to add a subscribe box to the WordPress blog.

 

  • First login to your WordPress Blog, Go to Appearance > Widgets.

wordpress-html-widget

  • Drag the Text (Arbitrary text of HTML) into your desired sidebar area on right hand side.
  • Insert the Subscribe Box Code in the content box and Click on Save.

add-subscribe-box-to-wordpr

  • Once you do that, Check your blog.
  • You will find the subscribe box.

feedburner-subscribe-box-for blogger

Feedburner Subscribe Box Series:

  1. How To Create Feedburner Subscribe Box
  2. How To Add Feedburner Subscribe Box to Blogger
  3. How To Add Feedburner Subscribe Box to WordPress