Tagged: WordPress

WordPress Plugin: WP-No-Format

Being a WordPress (and Blogging) newbie, I have been trying to find a way to customize the representation of my posts for a few days. With a bit of ‘Googling’, I found about Child Themes.

Great! This helps me further customize my pages and my change/update won’t be affected by theme update. However, when I tried to ‘preserve’ the white-spaces with white-space:pre in CSS, this created extra empty lines:
With 'white-space:pre':
3 Spaces in front of this line.
This line should be right below above statement.

See, there is an extra line between statements. This is because the WordPress Editor inserts <br/> for each new line, plus, I think, ‘pre’ option specified in the ‘white-space’ property also preserves new lines. This creates extra space (If I’m wrong here, please point out!)

Now, how do we easily overcome this…?

Install WP-No-Format WordPress plug-in!

This plugin lets you prevent WordPress from modifying the HTML written code.

It’s very easy to use. All you need to do is to wrap the text which you want to protect with <!– noformat on –> and <!– noformat off –>.

<!-- noformat on --> With 'white-space:pre': 3 spaces in front of this line. This line should be right below above statement. <!-- noformat off -->

This example above will produce this:

With 'white-space:pre': 3 Spaces in front of this line. This line should be right below above statement.

That’s more I like it.

That’s all!
-gibb