Tip for posting code

  • If you want to post code and have it be formatted correctly here on the forums, the trick is to put it in between backticks. A backtick is that button to the let of the numbers on your keyboard that looks like a funny single quote.

    Try it out with <code> now

  • Unknown's avatar

    when posting code, the backtick is good, but it’s still best to change your opening bracket (<) to &lt;

    that guarantees that the forum won’t try to execute your code.

  • Unknown's avatar

    Now I’m curious:

    * plain text:
    http://wordpress.com

    * with backticks (http-part gets stripped):
    http://wordpress.com

    * with the www prefix (www stripped):
    https://wordpress.com

    * with backticks and the prefix (http and www stripped):
    https://wordpress.com

    * HTML link without backticks:
    WP

    * HTML link with backticks:
    <a href="http://wordpress.com">WP</a>

  • Unknown's avatar

    Code and backticks:
    <code>http://tdjc.be</code>

    Backticks only:
    http://tdjc.be

    Code only:
    http://tdjc.be

    Well, I guess that’s one way to kick out a URL.

  • Unknown's avatar

    you have to encode one of the slashes.
    http://www.wordpress.com

    &#47;

  • Unknown's avatar

    yeah, andy, i saw you try and fail.

    in order to ‘double encode’ (i.e., show a character’s html value) you have to surround the ampersand in seperate backticks from the rest of the character.

    since i can’t make that any less geeky, here’s a link to a table of common characters:

    http://www.bbsinc.com/symbol.html

  • Unknown's avatar

    Great jumping junebugs! And, this is useful in what context please? WordPress advertises that one does not have to code to have a blog here. You just blog and they take care of the geekery.

    So if this thread is aimed at CSS folks wouldn’t adding CSS into the post title be helpful for those folks and also have a calming effect on the rest of us?

  • Unknown's avatar

    Great jumping junebugs! And, this is useful in what context please? WordPress advertises that one does not have to code to have a blog here. You just blog and they take care of the geekery.

    So if this thread is aimed at CSS folks wouldn’t adding CSS into the post title be helpful for those folks and also have a calming effect on the rest of us?

    Posted: 2006-08-05 02:34:27 #

  • Unknown's avatar

    @ahlis
    *lol* I made a humorous entry directed to the geeks above who know me and who would probably laugh at it. But you then copied it twice into the same thread. I’m wondering why you would do that so I’m asking: And your support question would be?

  • Unknown's avatar

    @tt-
    please note that this thread is in the CSS forum.
    hence, the need to explain how to post code.

  • Unknown's avatar

    @aunburntkamel
    I know that lol – all my best to you and the others ;)

  • Unknown's avatar

    WordPress advertises that one does not have to code to have a blog here. You just blog and they take care of the geekery.

    You’re right. This is for those who want to make these changes. If you don’t want to do any of this, then you don’t have to.

    Matt’s suggestion is for those who want or need to post snipets of code here in the CSS subforum.

  • The topic ‘Tip for posting code’ is closed to new replies.