WP-Syntax Plugin


I have been attempting to use the <pre> tag to simply copy and paste information into WordPress but the result has been that it doesn’t accept all the whitespace as being whitespace.

Anyway I installed WP-Syntax plugin and attempted to insert some code and it had all the code on the same line – no line breaks at all.

WP-Syntax uses <pre> to define where code begins and ends so I traced the problem to the style.css file which had:

pre {
  white-space: normal; /* why pre? */
}

The fix is to comment out the css for the pre element.

/* pre {
  white-space: normal; 
}
*/

style.css is located in the wp-content/themes/ /style.css

Once the css is commented out WP-Syntax then displays code as it should.

  1. #1 by r3dux on April 16, 2009 - 6:18 PM

    Good hack! Worked a treat for me – much appreciated!

(will not be published)

Powered by WP Hashcash