Skip to content


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.

Posted in Wordpress.


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. r3dux says

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

Continuing the Discussion

  1. How To: Compress a Directory of Files into Individual Archives | r3dux.org linked to this post on December 2, 2009

    [...] and cheers to James McDonald for his WP-Syntax hack to stop all the embedded code appearing on a single (incredibly long) line! digg_url = [...]



Some HTML is OK

or, reply to this post via trackback.

Powered by WP Hashcash