I cannot seem to get WordPress to display HTML code. It wants to render the code as HTML and I want it to show the HTML as code as I am putting up a short HTML/CSS tutorial for my students.
I have tried using pre tags and that it doesn’t work. I was thinking of putting up some GIF files, but I want the students to be able to cut-and-paste the code.
Is there a WordPress plug-in or technique that will allow me to show un-rendered HTML code?
All the best,
Prob’ly the 2 characters most likely to be the problem is the < and > characters. Use < and > instead. They will render as those two characters, but they will not trigger the HTML parsing. Here is a whole bunch of special characters you might find useful: http://www.tedmontgomery.com/tutorial/HTMLchrc.html
It my be as simple as putting the code inside code tags. Or you could change “special” characters to entities. eg. < as < or <
I haven’t tried this plugin http://wordpress.org/extend/plugins/code-markup/
or any of the code syntax highlighting plugins.
*hint, click on the “tags” to see related plugins.
There is an excellent post explaining how to display html source code in your wordpress posts (syntax highlighting too if you want it)