How to display html or javascript code in a Wordpress entry

You don’t think about it until you have to do it, but it’s difficult to print HTML code in a webpage (or blog) as actual HTML code.

I tried using the <code></code> tags in the wordpress toolbar, but to no avail.

The solution? Use the HTML equivalents for “<” and “>”.

“<” is    & l t   
“>” is    & g t

(remove the spaces between the characters in the HTML code, of course)

RELATED / YOU MIGHT FIND THESE INTERESTING




Like this story? Share with others on:
   del.icio.us    digg    reddit    furl      Stumble it!


COMMENTS / ONE COMMENT

Thanks!

Jordan added these pithy words on Mar 30 08 at 3:51 pm

SPEAK / ADD YOUR COMMENT
Comments are moderated.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Return to Top

Technorati Tags: