I’m too new to be able to comment on the answer I found here.
I’m trying to post source code and wp keeps adding CDATA et al to the code, causing it to not display correctly.
I changed wp-includes\post-template.php line 167 to this, as per the answer I found.
$content = str_replace('<![CDATA[','',$content); $content = str_replace(']]>','',$content); //$content = str_replace(']]>', ']]>', $content);
After amending that line, I’m still experiencing wp changing code around. Is there something else I can do to keep wp from messing things up?
Much as I hate answering with ‘use a plugin’ on SO there’s a few plugins that allow you to add code via a shortcode. I use an old one called Qoate on my blog (still works fine on 3.4);
http://wordpress.org/extend/plugins/qoate-simple-code-snippets/
A quick Google gives this one too;
http://wordpress.org/extend/plugins/wp-syntax/
Save yourself a load of hassle trying to set it all up and format it yourself (concentrate on writing the code to be displayed rather than the code to display it! 🙂 )