HelloARI logo: vinyl signs and identity design home«    web design«    sign design«    photography«    blog«    contact« 
web design and wordpress development 94114
blog»
san frnacisco web design

WordPress: adding extra line breaks, vertical space and more

There are issues with all the wysiwyg editors out there. It’s a problem with Drupal too. It’s hard to make a browser-based tool that just works right.

What WordPress is trying to do is “clean” the code. This is useful in many situations but not always.

First: remember that you can always get less space by using “shift” with the “return” (or “enter”) key. that will give you one line break as opposed to a paragraph space. But what many WordPress users find is that they add a few extra line breaks but they don’t show up.

TWO WORDPRESS LINE BREAK HACKS

Insert this in HTML mode to create line break that survives WP “cleaner” (look at html):
<div style="margin-bottom:2em;"><span style="display:none;">.</span></div>
Adjust “size” of line break via “margin” CSS tag.

.

This line has 2em set above it – just to prove the code above works! Make sure you don’t paste in curly/smart quotes.




OR if you just want one line break add <code><br ></code>. Note that this gets ‘cleaned’ whenever you switch from visual to html mode but it still works after the “br” part gets cleaned out. Again, you will see extra lines above this sentence.

.

PLUG-IN METHODS FOR LINE BREAKS

Turn off all cleaning with this

http://www.mensk.com/webmaster-toolbox/wordpress/how-to-prevent-wordpress-from-changing-tags-and-text-formatting-rich-text-editor

But that’s an issue with existing posts so not a flexible solution

Or try out the ‘advanced’ editor:

http://wordpress.org/extend/plugins/tinymce-advanced
http://www.laptoptips.ca/projects/tinymce-advanced

This post is helpful:

http://blog.ironspider.ca/2008/05/02/plain-text-wordpress-look-ma-no-curly-quotes

And this gives way more options:
http://plugins.trac.wordpress.org/wiki/TextControl
It reminds me of the MoveableType editor.

This simple plugin lets you to easily create columns via a shortcode:
http://wordpress.org/extend/plugins/wp-post-columns
but it can be sensitive to extra spaces. And I find the final [end_columns] code is not needed. Watch out in some themes where other CSS can conflict with how these columns are built.

This entry was posted in Web Design, WordPress. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

9 Comments

  1. H2U
    Posted August 21, 2009 at 11:05 am | Permalink

    You, sir, are my hero. Thank you.

  2. Posted August 30, 2009 at 10:30 am | Permalink

    I hope you do not mind if I posted a link on digg

  3. Posted July 19, 2010 at 5:08 pm | Permalink

    Thank you so much! TinyMCE Advanced is EXACTLY what I needed to resolve the problem!!

  4. Posted August 24, 2010 at 11:02 am | Permalink

    Awesome code stylie…thanks

  5. Posted September 28, 2010 at 6:14 am | Permalink

    Works great, but how can we go about incorporating directly into the style sheet so we don’t have to drop the code in the html view every time we want a line break?

  6. Posted September 28, 2010 at 8:53 pm | Permalink

    You’d have to add a style to your stylesheet and make reference to it. One trick i use is to take advantage one of the unused h4, h5 or h6 tags since they are in the default editor. Then they can be applied to some text just to add extra space below it.

  7. Jim
    Posted January 16, 2011 at 1:28 pm | Permalink
  8. chinedu
    Posted April 24, 2011 at 8:18 pm | Permalink

    thank you very much, really grateful.

  9. JustCallMeBradley
    Posted June 10, 2011 at 9:12 am | Permalink

    Your tip is still working 2 years later! Thanks a whole heap.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2012
contact  |  links  |  rss