Web Development

WordPress Visual Editor Removes Space Between Paragraphs – Fix

17 April 2010

I just updated Jesse’s work blog to WordPress from Blogger.  For all of Blogger’s faults the one thing it did do correctly was to place a new line between paragraphs when they were written in the WYSIWYG editor.  The visual editor in WordPress eliminates these spaces when publishing or switching from HTML to Visual.  I can manually insert the required html tags but Jesse won’t use the HTML editor so I needed a solution that would work automatically and take me out of her publishing process. Googling around produced many HTML based manual solutions to this problem but they are far from automatic.

The solution is to install and activate the TinyMCE Advanced plugin. Then go to Settings->TinyMCE Advanced and in the advanced box near the bottom click the checkbox for ‘Stop removing the <p> and <br/> tags when saving and show them in the HTML editor’ and save the changes.  If that doesn’t solve the problem, open your style.css file and add something like;

div.content p{

where ‘content’ is the id of your div were your post code is contained.

Also, if you you just want to place items on new lines without the space created by using <p> ,similar to the CSS code above, just highlight those lines and click the numbered list button twice. This will insert the required <br> tags.

Firefox Error: Permission denied to get property HTMLDocument.location

20 October 2007

I just came across an error in one of my sites that uses JavaScript to change what is displayed in an iframe when the user hits a button. Anyway, my original code looked like

document.iframe.location=’url to be displayed’;

This works fine in explorer but Firefox’s error console kept coming up with; “uncaught exception: Permission denied to get property HTMLDocument.location”. After a little searching I found the solution.

parent.iframe.location.href=’url to be displayed’;

If you run across this same error I hope this helps.