put HTML codes in comments. How?

  • Author
  • #141877

    How can i put HTML codes in comments or my posts and show them to others?



    last time I checked PRE elements (and many others) were stripped off by paranoid filters.

    that said, probably, you can’t… but did you try just put them in the comment box, what was the result?


    wordpress clean all of them.
    – I want to show some HTML Codes and tags to others, but wordpress clean all of them.



    Here’s the FAQs reference for html http://faq.wordpress.com/2006/06/08/allowed-html-tags/
    When it comes to using html in comment boxes I have found that this seems to be theme dependent. In some themes html is accepted in the comment boxes and in other themes it’s stripped out. Here’s an example from the Andreas 09 theme of what’s allowed in the comment boxes

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

    Note that the OP is using Kubrick and I do not see any legend in that theme indicating that any html can be used in comment boxes.



    tt it shouldn’t be theme dependant. Some themes do not include the stuff telling you what is allowed. And some themes use CSS differently. But the stripping process is not carried out at the theme level of abstraction.



    Thanks for correcting and enlightening me. Can you help with this “Kubrick” problem (stripping all html from comments) that the OP has?



    To put html into posts it needs to be either *escaped* or the html itself needs to be converted into characters eg &lgt; etc. There are generators that do that or you can do it in your head (if you can remember it) or look up a chart. Comments need the same. I think that’s what the guy means. He wants to post code so that it is read. Not processed. I think. :)


    I agree with 404’s interpretation. The user wants to show HTML, and the correct way is to escape the brackets. It’s very simple.

    Use the ampersand (&), followed by the letters (either “lt” for Less Than (<), or “gt” for Greater Than (>)), then a semicolon.

    I’d illustrate the usage, but the forum translates it even in a code block.


    It didn’t work.
    Persian language start from right to left. and when i try to put “>”, wordpress can’t know these codes. I will try again. thanx a lot.

The topic ‘put HTML codes in comments. How?’ is closed to new replies.