Forums

Quoting html on a programming topic (2 posts)

  1. yumadoug
    Member
    Posted 5 years ago #

    Does anyone know if there's a way to quote entire html tags in a web development-related post without having WordPress render the code (i.e. showing the link instead of the spelled-out code)? I was trying to instruct on the use of a tag, and ended up using a blockquote with only the contents of the tag. However, I'd prefer to display the entire tag, such as (and I'll have to break it up here for you) "<" "a href="wordpress.org" target="_blank"" ">".

    Thanks!

  2. Otto
    Tech Ninja
    Posted 5 years ago #

    There's a couple ways to do it.

    a) Replace the <'s and >'s with &lt; and &gt; characters, and &'s with &amp; characters.

    b) Use a plugin to automate this sort of thing, like this one: http://priyadi.net/archives/2005/09/27/wordpress-plugin-code-autoescape/
    There's other plugins to do similar things at the bottom of that page.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags